Skip to content

Commit

Permalink
Merge pull request #869 from navikt/feature/favorite-location-workaro…
Browse files Browse the repository at this point in the history
…uund

Fix missing location in favorite list
  • Loading branch information
otenav authored Nov 26, 2024
2 parents 937fe86 + e6d0527 commit 877076c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/app/(sok)/_components/searchResult/SearchResultItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,17 @@ interface SearchResultItemProps {
showExpired?: boolean;
favouriteButton: React.ReactNode;
isDebug: boolean;
favoriteLocation?: string;
}

export default function SearchResultItem({
ad,
showExpired,
favouriteButton,
isDebug,
favoriteLocation,
}: SearchResultItemProps): ReactElement {
const location = getWorkLocation(undefined, ad.locationList);
const location = favoriteLocation ? favoriteLocation : getWorkLocation(undefined, ad.locationList);
const employer = ad.employer?.name;
const published = formatDate(ad.published);
const hasInterestform = ad.hasInterestForm && ad.hasInterestForm === "true";
Expand Down
1 change: 1 addition & 0 deletions src/app/favoritter/_components/FavouritesListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ function FavouritesListItem({ favourite, onFavouriteDeleted, openErrorDialog }:
location: favourite.favouriteAd.location,
applicationDue: favourite.favouriteAd.applicationDue,
}}
favoriteLocation={favourite.favouriteAd.location}
showExpired={favourite.favouriteAd.status !== "ACTIVE"}
favouriteButton={
<Button variant="tertiary" onClick={openConfirmDeleteModal} icon={<TrashIcon aria-hidden="true" />}>
Expand Down

0 comments on commit 877076c

Please sign in to comment.