From 546ca0ddc7eca56cf9aa23022cbd6aa13157c631 Mon Sep 17 00:00:00 2001 From: Jannik Date: Sat, 27 Sep 2025 20:38:41 +0200 Subject: [PATCH] fix(stores): allow null data --- src/stores.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/stores.ts b/src/stores.ts index 513f98e..c41423a 100644 --- a/src/stores.ts +++ b/src/stores.ts @@ -28,6 +28,7 @@ export const vehicleStore = z .strict(); export const routeStore = z.object({ + name: z.string().min(1).max(100), locations: z.array( z.object({ lat: z.number().min(-90).max(90), @@ -80,6 +81,7 @@ export type SyncPayload = z.infer; export function verifyStoreData(type: StoreType, data: string) { const schema = storeTypes[type]; if (!schema) return false; + if(data === "null") return true; // allow null data try { const parsedData = JSON.parse(data); schema.parse(parsedData);