Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#357] Refactor endpoints with search #687

Merged
merged 9 commits into from
Feb 13, 2025

Conversation

SilviaAmAm
Copy link
Collaborator

@SilviaAmAm SilviaAmAm commented Feb 7, 2025

Fixes #357

The fix was a bit more invasive than expected.

I created a new search endpoint for the:

  • Zaken endpoint
  • Local zaaktypen choices endpoint

These endpoints do the same as the GET, but with a POST. The filter params then are passed into the request body instead of query params in the URL.

Since the Zaken list endpoint supports ordering and pagination, I had to support
passing these query params also through the request body.

@SilviaAmAm SilviaAmAm force-pushed the feature/357-refactor-zaken-endpoint branch from e121536 to ba30cea Compare February 7, 2025 16:03
@codecov-commenter
Copy link

codecov-commenter commented Feb 7, 2025

Codecov Report

Attention: Patch coverage is 98.52941% with 1 line in your changes missing coverage. Please review.

Project coverage is 90.32%. Comparing base (9c9bfb4) to head (ec4d6bd).

Files with missing lines Patch % Lines
backend/src/openarchiefbeheer/utils/paginators.py 88.88% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #687      +/-   ##
==========================================
+ Coverage   90.26%   90.32%   +0.05%     
==========================================
  Files         211      211              
  Lines        6248     6286      +38     
  Branches      675      675              
==========================================
+ Hits         5640     5678      +38     
  Misses        608      608              
Flag Coverage Δ
backend 91.07% <98.18%> (+0.05%) ⬆️
jest 32.71% <15.38%> (-0.03%) ⬇️
storybook 86.23% <100.00%> (+0.40%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@SilviaAmAm SilviaAmAm requested review from Xaohs and removed request for Xaohs February 10, 2025 09:40
@SilviaAmAm SilviaAmAm marked this pull request as draft February 10, 2025 09:41
@SilviaAmAm SilviaAmAm marked this pull request as ready for review February 10, 2025 11:37
@svenvandescheur
Copy link
Contributor

Do we know where the issue originates from, and can't we fix it with a setting? This fix feels a little bit intrusive to me and introduces inconsistency. I guess that's ok if its really needed but I'd like to see if we can find a simpeler solution.

@SilviaAmAm
Copy link
Collaborator Author

Do we know where the issue originates from, and can't we fix it with a setting? This fix feels a little bit intrusive to me and introduces inconsistency. I guess that's ok if its really needed but I'd like to see if we can find a simpeler solution.

This was the problem that the different browsers were giving different errors. I don't think we can fix this problem with a setting, if the frontend makes a request with a humongous URL, things might break before it gets to the backend. This SO answer is quite informative: https://stackoverflow.com/a/417184/7146757

frontend/src/lib/api/zaken.ts Outdated Show resolved Hide resolved
@SilviaAmAm SilviaAmAm force-pushed the feature/357-refactor-zaken-endpoint branch from bed01bc to f77ce45 Compare February 11, 2025 11:54
@@ -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(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this still used or can we safely remove it?

@SilviaAmAm SilviaAmAm force-pushed the feature/357-refactor-zaken-endpoint branch from f77ce45 to ec4d6bd Compare February 13, 2025 10:31
@SilviaAmAm SilviaAmAm merged commit eca3853 into main Feb 13, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

414 error on endpoint /api/v1/zaken/?zaaktype__in= [Backend/Frontend]
3 participants