From bf5ea5c3c23d7680bc89754f69947771932118f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matilda=20Landstr=C3=B6m?= Date: Thu, 5 Dec 2024 11:32:13 +0100 Subject: [PATCH] fix(SW-860): use is_contentstack_link option from CS --- .../contentstack/schemas/blocks/utils/buttonLinkSchema.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/routers/contentstack/schemas/blocks/utils/buttonLinkSchema.ts b/server/routers/contentstack/schemas/blocks/utils/buttonLinkSchema.ts index 62baefdab..29e2dd161 100644 --- a/server/routers/contentstack/schemas/blocks/utils/buttonLinkSchema.ts +++ b/server/routers/contentstack/schemas/blocks/utils/buttonLinkSchema.ts @@ -6,6 +6,7 @@ export const buttonSchema = z .object({ cta_text: z.string().optional().default(""), open_in_new_tab: z.boolean().default(false), + is_contentstack_link: z.boolean().default(false), external_link: z .object({ href: z.string().optional().default(""), @@ -34,7 +35,7 @@ export const buttonSchema = z }), }) .transform((data) => { - if (data.linkConnection?.edges?.length) { + if (data.linkConnection?.edges?.length && data.is_contentstack_link) { const link = data.linkConnection.edges[0].node return { href: link.url,