Skip to content

Commit 027205b

Browse files
kadiryaziciseambot
andauthored
fix(Thermostat Climate Presets): update form calls create endpoint (#685)
* fix(Thermostat Climate Presets): update form calls create endpoint * ci: Format code --------- Co-authored-by: Seam Bot <[email protected]>
1 parent e576bfd commit 027205b

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/lib/seam/thermostats/use-update-thermostat-climate-preset.ts

+3-5
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,8 @@ import { NullSeamClientError, useSeamClient } from 'lib/seam/use-seam-client.js'
1818
export type UseUpdateThermostatClimatePresetParams = never
1919
export type UseUpdateThermostatClimatePresetData = undefined
2020

21-
export type UseUpdateThermostatClimatePresetVariables = Omit<
22-
ThermostatsUpdateClimatePresetBody,
23-
'manual_override_allowed'
24-
>
21+
export type UseUpdateThermostatClimatePresetVariables =
22+
ThermostatsUpdateClimatePresetBody
2523

2624
export function useUpdateThermostatClimatePreset(): UseMutationResult<
2725
UseUpdateThermostatClimatePresetData,
@@ -38,7 +36,7 @@ export function useUpdateThermostatClimatePreset(): UseMutationResult<
3836
>({
3937
mutationFn: async (variables) => {
4038
if (client === null) throw new NullSeamClientError()
41-
await client.thermostats.createClimatePreset(variables)
39+
await client.thermostats.updateClimatePreset(variables)
4240
},
4341
onSuccess: (_data, variables) => {
4442
queryClient.setQueryData<ThermostatDevice | null>(

src/lib/ui/thermostat/ClimatePreset.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,7 @@ function UpdateForm({
359359
cooling_set_point_celsius: fahrenheitToCelsius(values.coolPoint),
360360
heating_set_point_celsius: fahrenheitToCelsius(values.heatPoint),
361361
hvac_mode_setting: values.hvacMode,
362+
manual_override_allowed: false, // deprecated but type still wants it.
362363
},
363364
{ onSuccess: onComplete }
364365
)

0 commit comments

Comments
 (0)