From 4ed5c203cd9757c5d517d6247ff9fead33adee1a Mon Sep 17 00:00:00 2001 From: Onur Yanar Date: Thu, 22 Aug 2024 21:20:32 +0300 Subject: [PATCH] fix: decode Webpage id to fix 404 on Webpages with nonsafe ids (#1301) * Fix: Decode Webpage Id to fix 404 on Webpages with nonsafe ids * chore: add changeset --------- Co-authored-by: Onur Yanar Co-authored-by: Daniel Almaguer --- .changeset/few-panthers-judge.md | 5 +++++ core/app/[locale]/(default)/webpages/normal/[id]/page.tsx | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changeset/few-panthers-judge.md diff --git a/.changeset/few-panthers-judge.md b/.changeset/few-panthers-judge.md new file mode 100644 index 000000000..2f9e83038 --- /dev/null +++ b/.changeset/few-panthers-judge.md @@ -0,0 +1,5 @@ +--- +"@bigcommerce/catalyst-core": patch +--- + +fix: decode webpage id to fix 404 on some Webpages diff --git a/core/app/[locale]/(default)/webpages/normal/[id]/page.tsx b/core/app/[locale]/(default)/webpages/normal/[id]/page.tsx index 7775ce863..ba7220d6d 100644 --- a/core/app/[locale]/(default)/webpages/normal/[id]/page.tsx +++ b/core/app/[locale]/(default)/webpages/normal/[id]/page.tsx @@ -43,7 +43,7 @@ const getWebpageData = cache(async (variables: { id: string }) => { }); export async function generateMetadata({ params: { id } }: Props): Promise { - const webpage = await getWebpageData({ id }); + const webpage = await getWebpageData({ id: decodeURIComponent(id) }); if (!webpage) { return {}; @@ -59,7 +59,7 @@ export async function generateMetadata({ params: { id } }: Props): Promise