Skip to content

Commit

Permalink
👌 [#357] PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
SilviaAmAm committed Feb 11, 2025
1 parent c44f2a9 commit f77ce45
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
14 changes: 13 additions & 1 deletion frontend/src/lib/api/zaken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,19 @@ export type PaginatedZaken = PaginatedResults<Zaak>;
* Retrieve zaken using the configured ZRC service. For information over the query parameters accepted and the schema of
* the response, look at the '/zaken/api/v1/zaken' list endpoint of Open Zaak.
*/
export async function listZaken(params?: Record<string, string>) {
export async function listZaken(
params?: URLSearchParams | Record<string, string>,
) {
const response = await request("GET", "/zaken/", params);
const promise: Promise<PaginatedZaken> = response.json();
return promise;
}

/**
* Search zaken using the configured ZRC service. For information over the filters that can be passed in the
* request body, look at query params of the '/zaken/api/v1/zaken' list endpoint of Open Zaak.
*/
export async function searchZaken(params?: Record<string, string>) {
const response = await request(
"POST",
"/zaken/search/",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { LoaderFunctionArgs } from "@remix-run/router/utils";

import { User } from "../../../lib/api/auth";
import { listReviewers } from "../../../lib/api/reviewers";
import { PaginatedZaken, listZaken } from "../../../lib/api/zaken";
import { PaginatedZaken, searchZaken } from "../../../lib/api/zaken";
import {
canStartDestructionListRequired,
loginRequired,
Expand Down Expand Up @@ -35,7 +35,7 @@ export const destructionListCreateLoader = loginRequired(

// Fetch reviewers, zaken, and choices concurrently
const [zaken, reviewers] = await Promise.all([
listZaken(searchParamsZakenEndpoint),
searchZaken(searchParamsZakenEndpoint),
listReviewers(),
]);

Expand Down

0 comments on commit f77ce45

Please sign in to comment.