Skip to content

Commit

Permalink
Mijn-9853-feature/url naar ma in tf bevestigingsmail van vergunning v…
Browse files Browse the repository at this point in the history
…akantieverhuur heeft verkeerde themanaam (#1671)

* Combine vergunningen en toeristische verhuur in zaakstatus

* Change imports

* Add identifier attrs

* Revert changes and add toeristischeVerhuur to pageRouteResolvers in ZaakStatus.tsx

* Handle empty array
  • Loading branch information
OscarBakker authored Dec 19, 2024
1 parent e3ab7b2 commit aaaf8ee
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions src/client/pages/ZaakStatus/ZaakStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { useAppStateGetter, useAppStateReady } from '../../hooks/useAppState';
const ITEM_NOT_FOUND = 'not-found';
const STATE_ERROR = 'state-error';

type ThemaQueryParam = 'vergunningen';
type ThemaQueryParam = 'vergunningen' | 'toeristischeVerhuur';

type PageRouteResolver = {
baseRoute: AppRoute;
Expand All @@ -41,13 +41,34 @@ const pageRouteResolvers: PageRouteResolvers = {
}
if (!isLoading(appState.VERGUNNINGEN)) {
return (
appState.VERGUNNINGEN.content?.find(
(appState.VERGUNNINGEN.content || []).find(
(vergunning) => vergunning.identifier === detailPageItemId
)?.link.to ?? ITEM_NOT_FOUND
);
}
},
},
toeristischeVerhuur: {
baseRoute: AppRoutes.TOERISTISCHE_VERHUUR,
getRoute: (detailPageItemId, appState) => {
if (isError(appState.TOERISTISCHE_VERHUUR)) {
return STATE_ERROR;
}

if (!isLoading(appState.TOERISTISCHE_VERHUUR)) {
return (
(
appState.TOERISTISCHE_VERHUUR.content
?.vakantieverhuurVergunningen || []
).find((toeristischeVerhuur) => {
if (toeristischeVerhuur.zaaknummer === detailPageItemId) {
return toeristischeVerhuur;
}
})?.link.to ?? ITEM_NOT_FOUND
);
}
},
},
};

function useNavigateToPage(queryParams: URLSearchParams) {
Expand Down

0 comments on commit aaaf8ee

Please sign in to comment.