@@ -119,7 +119,6 @@ export class DevicesRepository {
119119 } ,
120120 } )
121121 . prepare ( 'find_device_by_id' ) ;
122-
123122 }
124123
125124 async createDeviceStack ( newStack : NewDeviceStack ) : Promise < DeviceStack > {
@@ -137,13 +136,9 @@ export class DevicesRepository {
137136
138137 async findPhysicalDevicesByProjectId ( projectId : string , inRack ?: boolean ) {
139138 const inRackCondition =
140- inRack === undefined
141- ? undefined
142- : sql `(${ devices . rackId } IS NOT NULL) = ${ inRack } ` ;
139+ inRack === undefined ? undefined : sql `(${ devices . rackId } IS NOT NULL) = ${ inRack } ` ;
143140 const inRackServerCondition =
144- inRack === undefined
145- ? undefined
146- : sql `(${ servers . rackId } IS NOT NULL) = ${ inRack } ` ;
141+ inRack === undefined ? undefined : sql `(${ servers . rackId } IS NOT NULL) = ${ inRack } ` ;
147142
148143 const devicesQuery = this . buildBaseDevicesQuery ( ) . where (
149144 and ( eq ( devices . projectId , projectId ) , inRackCondition ) ,
@@ -152,9 +147,7 @@ export class DevicesRepository {
152147 and ( eq ( servers . projectId , projectId ) , inRackServerCondition ) ,
153148 ) ;
154149
155- return this . db
156- . select ( )
157- . from ( unionAll ( devicesQuery , serversQuery ) . as ( 'combined_devices' ) ) ;
150+ return this . db . select ( ) . from ( unionAll ( devicesQuery , serversQuery ) . as ( 'combined_devices' ) ) ;
158151 }
159152
160153 async findPhysicalDevicesByIdsAndProjectId (
@@ -170,7 +163,9 @@ export class DevicesRepository {
170163
171164 return this . db
172165 . select ( )
173- . from ( unionAll ( devicesQuery , serversQuery ) . as ( 'combined_devices_by_ids' ) ) as unknown as Promise < DeviceWithRelations [ ] > ;
166+ . from (
167+ unionAll ( devicesQuery , serversQuery ) . as ( 'combined_devices_by_ids' ) ,
168+ ) as unknown as Promise < DeviceWithRelations [ ] > ;
174169 }
175170
176171 private buildBaseDevicesQuery ( ) {
0 commit comments