feat: improve structure and error handling

This commit is contained in:
Michael Zetterberg
2024-05-14 15:55:46 +02:00
parent 01587d7fd5
commit f5108d1a8e
104 changed files with 1505 additions and 1570 deletions
-13
View File
@@ -1,13 +0,0 @@
import z from "zod"
export const validateContentTypeUid = z.object({
all_content_page: z.object({
total: z.number(),
}),
all_loyalty_page: z.object({
total: z.number(),
}),
all_current_blocks_page: z.object({
total: z.number(),
}),
})
+19
View File
@@ -0,0 +1,19 @@
import z from "zod"
const entryResolveSchema = z.object({
items: z.array(
z.object({
system: z.object({
content_type_uid: z.string(),
uid: z.string(),
}),
})
),
total: z.number(),
})
export const validateEntryResolveSchema = z.object({
all_content_page: entryResolveSchema,
all_loyalty_page: entryResolveSchema,
all_current_blocks_page: entryResolveSchema,
})
-10
View File
@@ -1,10 +0,0 @@
import type { Image } from "../../image"
import type { EdgesWithTotalCount } from "../utils/edges"
export type LogoQueryData = {
all_header: {
items: {
logoConnection: EdgesWithTotalCount<Image>
}[]
}
}
-4
View File
@@ -15,10 +15,6 @@ export type MenuItem = {
subItems?: MenuItem[]
}
export type SidebarProps = {
lang: Lang
}
interface NavigationLink {
system: {
locale: Lang