From ced8dd5d99a8e770a4e74364103d147387743d01 Mon Sep 17 00:00:00 2001 From: Christian Andolf Date: Thu, 6 Feb 2025 08:49:49 +0100 Subject: [PATCH] fix: startpage blocks now default to an array --- components/ContentType/StartPage/index.tsx | 2 +- server/routers/contentstack/startPage/output.ts | 4 +++- server/routers/contentstack/startPage/query.ts | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/components/ContentType/StartPage/index.tsx b/components/ContentType/StartPage/index.tsx index 01e174ecd..65769149d 100644 --- a/components/ContentType/StartPage/index.tsx +++ b/components/ContentType/StartPage/index.tsx @@ -45,7 +45,7 @@ export default async function StartPage() { ) : null}
- {(blocks || []).map((block, index) => { + {blocks.map((block, index) => { if (block.typename === BlocksEnums.block.FullWidthCampaign) { return ( val || []), system: systemSchema.merge( z.object({ created_at: z.string(), diff --git a/server/routers/contentstack/startPage/query.ts b/server/routers/contentstack/startPage/query.ts index 14933cf81..20135b6fa 100644 --- a/server/routers/contentstack/startPage/query.ts +++ b/server/routers/contentstack/startPage/query.ts @@ -189,7 +189,7 @@ export const startPageQueryRouter = router({ return { startPage: { ...startPage.data.start_page, - blocks: startPage.data.start_page.blocks?.filter((block) => { + blocks: startPage.data.start_page.blocks.filter((block) => { if ( block.typename === BlocksEnums.block.JoinScandicFriends && session