Skip to content

Commit c6723fb

Browse files
committed
ci: Format code
1 parent 49a93b6 commit c6723fb

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

src/lib/seam/devices/use-set-device-name.ts

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,16 @@ export type UseSetDeviceNameParams = never
1616

1717
export type UseSetDeviceNameData = undefined
1818

19-
export type UseSetDeviceNameMutationVariables = Pick<DevicesUpdateBody, 'device_id' | 'name'>
19+
export type UseSetDeviceNameMutationVariables = Pick<
20+
DevicesUpdateBody,
21+
'device_id' | 'name'
22+
>
2023

2124
type MutationError = SeamHttpApiError
2225

23-
export function useSetDeviceName(params: DevicesGetParams): UseMutationResult<
26+
export function useSetDeviceName(
27+
params: DevicesGetParams
28+
): UseMutationResult<
2429
UseSetDeviceNameData,
2530
MutationError,
2631
UseSetDeviceNameMutationVariables
@@ -38,15 +43,17 @@ export function useSetDeviceName(params: DevicesGetParams): UseMutationResult<
3843
await client.devices.update(variables)
3944
},
4045
onSuccess: (_data, variables) => {
41-
4246
queryClient.setQueryData<Device | null>(
4347
['devices', 'get', params],
4448
(device) => {
4549
if (device == null) {
4650
return
4751
}
4852

49-
return getUpdatedDevice(device, variables.name ?? device.properties.name)
53+
return getUpdatedDevice(
54+
device,
55+
variables.name ?? device.properties.name
56+
)
5057
}
5158
)
5259

@@ -59,7 +66,10 @@ export function useSetDeviceName(params: DevicesGetParams): UseMutationResult<
5966

6067
return devices.map((device) => {
6168
if (device.device_id === variables.device_id) {
62-
return getUpdatedDevice(device, variables.name ?? device.properties.name)
69+
return getUpdatedDevice(
70+
device,
71+
variables.name ?? device.properties.name
72+
)
6373
}
6474

6575
return device
@@ -80,4 +90,4 @@ const getUpdatedDevice = (device: Device, name: string): Device => {
8090
name,
8191
},
8292
}
83-
}
93+
}

0 commit comments

Comments
 (0)