Skip to content

Commit

Permalink
♻️ Add IJobPostings interface
Browse files Browse the repository at this point in the history
  • Loading branch information
petterhh committed Nov 29, 2024
1 parent fd9fb38 commit 90eee76
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/components/sections/jobs/Jobs.tsx
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -13,7 +13,7 @@ export interface JobsProps {
}

export default async function Jobs({ language, section }: JobsProps) {
const { data: jobPostings } = await loadStudioQuery<IJobPosting[] | null>(
const { data: jobPostings } = await loadStudioQuery<IJobPostings | null>(
JOB_POSTINGS_QUERY,
{
language,
Expand Down
5 changes: 4 additions & 1 deletion studio/lib/interfaces/jobPosting.ts
Original file line number Diff line number Diff line change
@@ -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[];
}
1 change: 1 addition & 0 deletions studio/lib/queries/admin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[] -> {
Expand Down

0 comments on commit 90eee76

Please sign in to comment.