From 44bc7d03cedb24d4c0bf2f44a4cfcf0b0a86f6fa Mon Sep 17 00:00:00 2001 From: Marius Krakeli Date: Mon, 23 Sep 2024 12:56:15 +0200 Subject: [PATCH] Add support for multiple locations on job listings (#674) * Add support for multiple locations on job listings * Remove console.log. Co-authored-by: Jakob Endrestad Kielland <31799931+itzjacki@users.noreply.github.com> * edit: Listing items done correct --------- Co-authored-by: Jakob Endrestad Kielland <31799931+itzjacki@users.noreply.github.com> --- src/jobs/list-item.tsx | 21 +++++++++++++++++++-- src/jobs/utils/getListings.ts | 8 ++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/src/jobs/list-item.tsx b/src/jobs/list-item.tsx index 38e4fdee1..406cf065b 100644 --- a/src/jobs/list-item.tsx +++ b/src/jobs/list-item.tsx @@ -7,6 +7,14 @@ export type JobItem = { name: string; title: string; location: string; + locations: Array; +}; + +export type Location = { + city: string; + state: string; + country: string; + street: string; }; export type JobListingItemProps = { item: JobItem; @@ -16,9 +24,18 @@ export default function JobListingItem({ item }: JobListingItemProps) {

{item.title}

- {item.location} + + {item.locations + .map((location) => { + return location.city; + }) + .join(', ')} +
- + Se på stillingen
diff --git a/src/jobs/utils/getListings.ts b/src/jobs/utils/getListings.ts index 4448b81de..97980c99f 100644 --- a/src/jobs/utils/getListings.ts +++ b/src/jobs/utils/getListings.ts @@ -72,9 +72,17 @@ type Offer = { position: number; department?: string; location: string; + locations: Array; company_name: string; }; +type Location = { + city: string, + state: string, + country: string, + street: string, +} + type OfferResult = { offers: Array; };