Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a language param to customer case query #715

Merged
merged 2 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/customerCases/CustomerCases.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ const CustomerCases = async ({ customerCasesPage }: CustomerCasesProps) => {
const { perspective } = getDraftModeInfo();

const [sharedCustomerCases] = await Promise.all([
loadSharedQuery<CustomerCase[]>(CUSTOMER_CASES_QUERY, {}, { perspective }),
loadSharedQuery<CustomerCase[]>(
CUSTOMER_CASES_QUERY,
{ language: "en" },
{ perspective },
), //TODO: Replace hard coded language with selected language
]);

return (
Expand Down
2 changes: 1 addition & 1 deletion studioShared/lib/queries/customerCases.ts
Original file line number Diff line number Diff line change
@@ -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]
`;