diff --git a/src/components/sections/jobs/Jobs.tsx b/src/components/sections/jobs/Jobs.tsx index b3952cef5..a4c25bba0 100644 --- a/src/components/sections/jobs/Jobs.tsx +++ b/src/components/sections/jobs/Jobs.tsx @@ -1,6 +1,6 @@ import JobPosting from "src/components/jobPosting/JobPosting"; import Text from "src/components/text/Text"; -import { IJobPosting } from "studio/lib/interfaces/jobPosting"; +import { IJobPosting, IJobPostings } from "studio/lib/interfaces/jobPosting"; import { JobsSection } from "studio/lib/interfaces/pages"; import { JOB_POSTINGS_QUERY } from "studio/lib/queries/admin"; import { loadStudioQuery } from "studio/lib/store"; @@ -13,7 +13,7 @@ export interface JobsProps { } export default async function Jobs({ language, section }: JobsProps) { - const { data: jobPostings } = await loadStudioQuery( + const { data: jobPostings } = await loadStudioQuery( JOB_POSTINGS_QUERY, { language, diff --git a/studio/lib/interfaces/jobPosting.ts b/studio/lib/interfaces/jobPosting.ts index 71099ee15..15afccab0 100644 --- a/studio/lib/interfaces/jobPosting.ts +++ b/studio/lib/interfaces/jobPosting.ts @@ -1,9 +1,12 @@ import { CompanyLocation } from "studio/lib/interfaces/companyDetails"; export interface IJobPosting { - _type: "jobPosting"; _key: string; role: string; locations: CompanyLocation[]; recruiteeAdUrl: string; } + +export interface IJobPostings { + jobPostingsArray: IJobPosting[]; +} diff --git a/studio/lib/queries/admin.ts b/studio/lib/queries/admin.ts index abe813049..a50e69322 100644 --- a/studio/lib/queries/admin.ts +++ b/studio/lib/queries/admin.ts @@ -27,6 +27,7 @@ export const LEGAL_DOCUMENTS_SITEMAP_QUERY = groq` export const JOB_POSTINGS_QUERY = groq` *[_type == "jobPostings"][0] { jobPostingsArray[] { + _key, recruiteeAdUrl, "role": ${translatedFieldFragment("role")}, locations[] -> {