From c0d417b8af05e8f2228c2f6be82a4aa2cacf5096 Mon Sep 17 00:00:00 2001 From: anemne <63043552+anemne@users.noreply.github.com> Date: Thu, 26 Sep 2024 10:13:30 +0200 Subject: [PATCH] Add a language param to customer case query (#715) * add a lang param to customer case query * replace lang with english --- src/customerCases/CustomerCases.tsx | 6 +++++- studioShared/lib/queries/customerCases.ts | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/customerCases/CustomerCases.tsx b/src/customerCases/CustomerCases.tsx index 9ab8c5615..ced342cf1 100644 --- a/src/customerCases/CustomerCases.tsx +++ b/src/customerCases/CustomerCases.tsx @@ -18,7 +18,11 @@ const CustomerCases = async ({ customerCasesPage }: CustomerCasesProps) => { const { perspective } = getDraftModeInfo(); const [sharedCustomerCases] = await Promise.all([ - loadSharedQuery(CUSTOMER_CASES_QUERY, {}, { perspective }), + loadSharedQuery( + CUSTOMER_CASES_QUERY, + { language: "en" }, + { perspective }, + ), //TODO: Replace hard coded language with selected language ]); return ( diff --git a/studioShared/lib/queries/customerCases.ts b/studioShared/lib/queries/customerCases.ts index a8b2043c8..c9b243d98 100644 --- a/studioShared/lib/queries/customerCases.ts +++ b/studioShared/lib/queries/customerCases.ts @@ -1,4 +1,4 @@ import { groq } from "next-sanity"; -export const CUSTOMER_CASES_QUERY = groq`*[_type == "customerCase"] +export const CUSTOMER_CASES_QUERY = groq`*[_type == "customerCase" && language == $language] `;