From 1d7e65a16dad5382fa2acea452a41be952bca339 Mon Sep 17 00:00:00 2001 From: Emma Fabre Date: Mon, 13 Jan 2025 16:03:07 +0100 Subject: [PATCH 1/3] Filter out REJECTED locations in Recent Locations --- src/pages/steps/hooks/useRecentLocations.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pages/steps/hooks/useRecentLocations.ts b/src/pages/steps/hooks/useRecentLocations.ts index 531466f4e..f7c3f1e73 100644 --- a/src/pages/steps/hooks/useRecentLocations.ts +++ b/src/pages/steps/hooks/useRecentLocations.ts @@ -3,6 +3,7 @@ import { uniqBy } from 'lodash'; import { useGetOffersByCreatorQuery } from '@/hooks/api/offers'; import { useGetUserQuery } from '@/hooks/api/user'; import { Offer } from '@/types/Offer'; +import { WorkflowStatus } from '@/types/WorkflowStatus'; const useRecentLocations = () => { const getUserQuery = useGetUserQuery(); @@ -38,6 +39,7 @@ const useRecentLocations = () => { .filter( (location) => location && + location?.workflowStatus !== WorkflowStatus.REJECTED && location?.name?.nl !== 'Online' && !('duplicateOf' in location), ) From f04bdb54f40accaacc6d2b3b44dd3605cf99aff8 Mon Sep 17 00:00:00 2001 From: Emma Fabre Date: Mon, 13 Jan 2025 16:03:40 +0100 Subject: [PATCH 2/3] Add DELETED as well --- src/pages/steps/hooks/useRecentLocations.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/steps/hooks/useRecentLocations.ts b/src/pages/steps/hooks/useRecentLocations.ts index f7c3f1e73..5e188ae9a 100644 --- a/src/pages/steps/hooks/useRecentLocations.ts +++ b/src/pages/steps/hooks/useRecentLocations.ts @@ -40,6 +40,7 @@ const useRecentLocations = () => { (location) => location && location?.workflowStatus !== WorkflowStatus.REJECTED && + location?.workflowStatus !== WorkflowStatus.DELETED && location?.name?.nl !== 'Online' && !('duplicateOf' in location), ) From b935e2f69ea001e1ab4d0280112dc76f83ac7403 Mon Sep 17 00:00:00 2001 From: Emma Fabre Date: Tue, 14 Jan 2025 11:04:43 +0100 Subject: [PATCH 3/3] Remove unnecessary nullsafe operator in filter --- src/pages/steps/hooks/useRecentLocations.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/steps/hooks/useRecentLocations.ts b/src/pages/steps/hooks/useRecentLocations.ts index 5e188ae9a..732dbe740 100644 --- a/src/pages/steps/hooks/useRecentLocations.ts +++ b/src/pages/steps/hooks/useRecentLocations.ts @@ -39,9 +39,9 @@ const useRecentLocations = () => { .filter( (location) => location && - location?.workflowStatus !== WorkflowStatus.REJECTED && - location?.workflowStatus !== WorkflowStatus.DELETED && - location?.name?.nl !== 'Online' && + location.workflowStatus !== WorkflowStatus.REJECTED && + location.workflowStatus !== WorkflowStatus.DELETED && + location.name?.nl !== 'Online' && !('duplicateOf' in location), ) .slice(0, 4);