Merged in feat/SW-1751-destination-0-results (pull request #1448)

feat(SW-1751): Added alert if no results are found, also implemented default location data from Contentstack

* feat(SW-1751): Added alert if no results are found, also implemented default location data from Contentstack


Approved-by: Matilda Landström
This commit is contained in:
Erik Tiekstra
2025-03-03 10:32:40 +00:00
parent c3e3fa62ec
commit 93187a9c33
31 changed files with 372 additions and 206 deletions

View File

@@ -0,0 +1,25 @@
import { z } from "zod"
export const mapLocationSchema = z
.object({
longitude: z.number().nullable(),
latitude: z.number().nullable(),
default_zoom: z.number().nullable(),
})
.nullish()
.transform((val) => {
if (val) {
const longitude = val.longitude
const latitude = val.latitude
const default_zoom = val.default_zoom || 3
if (longitude !== null && latitude !== null) {
return {
longitude,
latitude,
default_zoom: Math.round(default_zoom),
}
}
}
return null
})