Skip to content

Commit

Permalink
refactor(customerCases): format GROQ query and add language field fra…
Browse files Browse the repository at this point in the history
…gment
  • Loading branch information
mathiazom committed Oct 16, 2024
1 parent cbd1377 commit fa5bf24
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions studioShared/lib/queries/customerCases.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import { groq } from "next-sanity";

import { LANGUAGE_FIELD_FRAGMENT } from "studio/lib/queries/i18n";
import { translatedFieldFragment } from "studio/lib/queries/utils/i18n";

export const CUSTOMER_CASES_QUERY = groq`*[_type == "customerCase"]{
"language": $language,
"basicTitle": ${translatedFieldFragment("basicTitle")},
"richText": ${translatedFieldFragment("richText")}}
export const CUSTOMER_CASES_QUERY = groq`
*[_type == "customerCase"]{
${LANGUAGE_FIELD_FRAGMENT},
"basicTitle": ${translatedFieldFragment("basicTitle")},
"richText": ${translatedFieldFragment("richText")}
}
`;

export const CUSTOMER_CASE_QUERY = groq`*[_type == "customerCase" && slug.current == $slug && language == $language][0]`;
Expand Down

0 comments on commit fa5bf24

Please sign in to comment.