feat: add configurable wind units
This commit is contained in:
@@ -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.");
|
||||
|
||||
Reference in New Issue
Block a user