feat: improve structure and error handling
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
export type LogoProps = {
|
||||
height: number
|
||||
src: string
|
||||
title: string
|
||||
width: number
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
import type { LangParams, LayoutArgs } from "@/types/params"
|
||||
|
||||
export interface MyPagesLayoutProps extends LayoutArgs<LangParams> {
|
||||
breadcrumbs: React.ReactNode
|
||||
}
|
||||
+13
-1
@@ -12,8 +12,20 @@ export type LangParams = {
|
||||
lang: Lang
|
||||
}
|
||||
|
||||
export type StatusParams = {
|
||||
status: number
|
||||
}
|
||||
|
||||
export type ContentTypeParams = {
|
||||
contentType: "loyalty-page" | "content-page"
|
||||
}
|
||||
|
||||
export type UIDParams = {
|
||||
uid: string
|
||||
}
|
||||
|
||||
export type UriParams = {
|
||||
uri?: string
|
||||
uri: string | string[]
|
||||
}
|
||||
|
||||
export type PreviewParams = {
|
||||
|
||||
@@ -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(),
|
||||
}),
|
||||
})
|
||||
@@ -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,
|
||||
})
|
||||
@@ -1,10 +0,0 @@
|
||||
import type { Image } from "../../image"
|
||||
import type { EdgesWithTotalCount } from "../utils/edges"
|
||||
|
||||
export type LogoQueryData = {
|
||||
all_header: {
|
||||
items: {
|
||||
logoConnection: EdgesWithTotalCount<Image>
|
||||
}[]
|
||||
}
|
||||
}
|
||||
@@ -15,10 +15,6 @@ export type MenuItem = {
|
||||
subItems?: MenuItem[]
|
||||
}
|
||||
|
||||
export type SidebarProps = {
|
||||
lang: Lang
|
||||
}
|
||||
|
||||
interface NavigationLink {
|
||||
system: {
|
||||
locale: Lang
|
||||
|
||||
Reference in New Issue
Block a user