From 3e13a865817eca9b6d5ecad882ce2d844ea16c1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Pe=CC=81ault?= Date: Fri, 24 Jun 2022 12:26:38 +0200 Subject: [PATCH] Handle inexistant location page --- src/routes/[country]/[location]/index.ts | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/routes/[country]/[location]/index.ts b/src/routes/[country]/[location]/index.ts index fd6430d..bbd1986 100644 --- a/src/routes/[country]/[location]/index.ts +++ b/src/routes/[country]/[location]/index.ts @@ -16,14 +16,14 @@ export const photoFields = ` export async function get({ params }: RequestEvent): Promise { try { - const { location } = params + const { location: slug } = params // Query const res = await fetchAPI(` query { location ( filter: { - slug: { _eq: "${location}" }, + slug: { _eq: "${slug}" }, status: { _eq: "published" }, } ) { @@ -47,7 +47,7 @@ export async function get({ params }: RequestEvent): Promise