Skip to content

Commit 0d4da60

Browse files
committed
✨ [#726] Update frontend to filter on identificatie instead of URL
1 parent e4927c1 commit 0d4da60

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

frontend/src/lib/api/private.ts

+12-10
Original file line numberDiff line numberDiff line change
@@ -9,60 +9,62 @@ import { request } from "./request";
99
* Retrieve informatieobjecttypen from Open Zaak and return a value and a label per informatieobjecttype. The label is
1010
* the field 'omschrijving'.
1111
*/
12-
export async function listInformatieObjectTypeChoices(zaaktypeUrl?: string) {
12+
export async function listInformatieObjectTypeChoices(
13+
zaaktypeIdentificatie?: string,
14+
) {
1315
return cacheMemo(
1416
"listInformatieObjectTypeChoices",
1517
async () => {
1618
const response = await request("GET", "/_informatieobjecttype-choices/", {
17-
zaaktype: zaaktypeUrl,
19+
zaaktypeIdentificatie: zaaktypeIdentificatie,
1820
});
1921
const promise: Promise<Option[]> = response.json();
2022

2123
return promise;
2224
},
23-
[zaaktypeUrl],
25+
[zaaktypeIdentificatie],
2426
);
2527
}
2628

2729
/**
2830
* Retrieve statustypen from Open Zaak and return a value and a label per statustype. The label is the field
2931
* 'omschrijving'.
3032
*/
31-
export async function listStatusTypeChoices(zaaktypeUrl?: string) {
33+
export async function listStatusTypeChoices(zaaktypeIdentificatie?: string) {
3234
return cacheMemo(
3335
"listStatusTypeChoices",
3436
async () => {
3537
const response = await request("GET", "/_statustype-choices/", {
36-
zaaktype: zaaktypeUrl,
38+
zaaktypeIdentificatie: zaaktypeIdentificatie,
3739
});
3840
const promise: Promise<Option[]> = response.json();
3941

4042
return promise;
4143
},
42-
[zaaktypeUrl],
44+
[zaaktypeIdentificatie],
4345
);
4446
}
4547

4648
/**
4749
* Retrieve resultaattypen from Open Zaak and return a value and a label per
4850
* resultaattype. The label is the field 'omschrijving'.
4951
*/
50-
export async function listResultaatTypeChoices(zaaktypeUrl?: string) {
52+
export async function listResultaatTypeChoices(zaaktypeIdentificatie?: string) {
5153
return cacheMemo(
5254
"listResultaatTypeChoices",
5355
async () => {
5456
const response = await request(
5557
"GET",
5658
"/_external-resultaattype-choices/",
5759
{
58-
zaaktype: zaaktypeUrl,
60+
zaaktypeIdentificatie: zaaktypeIdentificatie,
5961
},
6062
);
6163
const promise: Promise<Option[]> = response.json();
6264

6365
return promise;
6466
},
65-
[zaaktypeUrl],
67+
[zaaktypeIdentificatie],
6668
);
6769
}
6870

@@ -98,7 +100,7 @@ export async function listSelectielijstKlasseChoices(
98100

99101
/**
100102
* Retrieve zaaktypen from Open Zaak and return a value and a label per zaaktype.
101-
* The label is the 'omschrijving' field, and the value is the URL. The response is cached for 15 minutes.
103+
* The label is the 'omschrijving' field, and the value is the identificatie. The response is cached for 15 minutes.
102104
* @param [params] - Additional search parameters for filtering (this keeps filters in sync with objects on page).
103105
* @param [external=false] - Fetch zaaktypen from ZRC Service (Open Zaak) (slower/can't be combined with other filtering options).
104106
* @param signal - Abort signal, should be called in cleanup function in React `useEffect()` hooks.

frontend/src/pages/settings/pages/destruction-report/DestructionReportSettingsPage.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export function DestructionReportSettingsPage() {
6464
[valuesState.zaaktype],
6565
);
6666
const { data: informatieObjectTypeChoices } = useDataFetcher(
67-
() => listInformatieObjectTypeChoices(valuesState.zaakType),
67+
() => listInformatieObjectTypeChoices(valuesState.zaaktype),
6868
{
6969
initialState: [],
7070
errorMessage:

0 commit comments

Comments
 (0)