feat: add configurable wind units

This commit is contained in:
zv
2026-06-13 13:36:36 +02:00
parent a8d4d1e23c
commit 7ad95550eb
21 changed files with 152 additions and 38 deletions

View File

@@ -1,5 +1,6 @@
import type { Language } from "@/lib/i18n";
import type { Province } from "@/types/province";
import type { WindSpeedUnit } from "@/types/units";
interface VapidKeyResponse {
configured: boolean;
@@ -19,6 +20,7 @@ interface SavePushSubscriptionOptions {
longitude?: number | null;
locationName?: string | null;
countyTeryt?: string | null;
windSpeedUnit?: WindSpeedUnit;
}
export async function savePushSubscription(subscription: PushSubscription, province: Province, language: Language, options: SavePushSubscriptionOptions = {}) {
@@ -36,6 +38,7 @@ export async function savePushSubscription(subscription: PushSubscription, provi
longitude: options.longitude ?? null,
locationName: options.locationName ?? null,
countyTeryt: options.countyTeryt ?? null,
windSpeedUnit: options.windSpeedUnit,
}),
});
if (!response.ok) throw new Error("Unable to save push subscription.");