feat: add weather unit preferences
Some checks failed
CI / Lint, test, typecheck and build (push) Has been cancelled
Some checks failed
CI / Lint, test, typecheck and build (push) Has been cancelled
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import type { Language } from "@/lib/i18n";
|
||||
import type { Province } from "@/types/province";
|
||||
import type { TemperatureUnit, WindSpeedUnit } from "@/types/units";
|
||||
import type { DistanceUnit, PrecipitationUnit, PressureUnit, TemperatureUnit, WindSpeedUnit } from "@/types/units";
|
||||
import type { WeatherRegion } from "@/types/weather-region";
|
||||
|
||||
interface VapidKeyResponse {
|
||||
@@ -26,6 +26,9 @@ interface SavePushSubscriptionOptions {
|
||||
countyTeryt?: string | null;
|
||||
temperatureUnit?: TemperatureUnit;
|
||||
windSpeedUnit?: WindSpeedUnit;
|
||||
precipitationUnit?: PrecipitationUnit;
|
||||
pressureUnit?: PressureUnit;
|
||||
distanceUnit?: DistanceUnit;
|
||||
}
|
||||
|
||||
export async function savePushSubscription(
|
||||
@@ -52,6 +55,9 @@ export async function savePushSubscription(
|
||||
countyTeryt: options.countyTeryt ?? null,
|
||||
temperatureUnit: options.temperatureUnit,
|
||||
windSpeedUnit: options.windSpeedUnit,
|
||||
precipitationUnit: options.precipitationUnit,
|
||||
pressureUnit: options.pressureUnit,
|
||||
distanceUnit: options.distanceUnit,
|
||||
}),
|
||||
});
|
||||
if (!response.ok) throw new Error("Unable to save push subscription.");
|
||||
|
||||
Reference in New Issue
Block a user