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

feat: filter and sort backend #68

Merged
merged 17 commits into from
Apr 22, 2022
Merged

feat: filter and sort backend #68

merged 17 commits into from
Apr 22, 2022

Conversation

Xtrah
Copy link
Member

@Xtrah Xtrah commented Apr 4, 2022

Closes #56

Summary of changes

Filter applications based on queries

  • GET /applications?name=[query]
  • GET /applications?status=[status] status: all possible statuses (is also validated) e.g. Pending
  • GET /applications?sort=[sort_attribute] sort_attribute: name_asc, name_desc, date_asc, date_desc
  • GET /applications?committee=[committeeID] can be repeated e.g. (committee=3&committee=10)

This also includes validation of queries,:

  • Name only accepts strings
  • Status only accepts strings within the StatusTypes-enum
  • Sort only accetpts strings within the SortType-enum
  • Committee only accepts integers

@Xtrah Xtrah force-pushed the feat/filter-sort-backend branch from fe8b04b to 18c9776 Compare April 4, 2022 14:45
@Xtrah Xtrah added the backend 🍑 Backend tasks label Apr 6, 2022
@Xtrah Xtrah changed the title feat: backend filter on name query feat: filter and sort backend Apr 8, 2022
@LiviaValenti LiviaValenti force-pushed the feat/filter-sort-backend branch 2 times, most recently from feca98b to 1624e7b Compare April 19, 2022 16:11
@LiviaValenti LiviaValenti marked this pull request as ready for review April 19, 2022 16:28
@LiviaValenti
Copy link
Collaborator

I can't seem to find the possibility to assign you as reviewer @Xtrah as you created this PR. So this tag represents a request for review 🤺

@LiviaValenti LiviaValenti force-pushed the feat/filter-sort-backend branch from 5176852 to 75a2829 Compare April 20, 2022 17:33
Copy link
Contributor

@SanderArntzen SanderArntzen left a comment

Choose a reason for hiding this comment

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

I can't get this solution to work. The name-filter partially work, committee-filter don't work, status-filter partially work, and sort dosn't work. I tested through Postman. When I say don't work/partially work, I mean that it either returns all applications, or some applications, but not the right ones, or no applications at all, even though it should return at least one

@LiviaValenti
Copy link
Collaborator

LiviaValenti commented Apr 21, 2022

Outdated:

Current: ⚠️ committee and not committees as a query param

Previous: ⚠️ committees and not committee as a query param

I changed that without updating the PR description. @SanderArntzen can you test again after the page-default fix and present concrete test-cases :0 ?

Here is an example-query that should work as expected if you have any applications sent from people with name that contains 'Liv' that is to a committee with id 5: http://localhost:8082/applications?name=Liv&committees=5&order=date_desc

@LiviaValenti LiviaValenti force-pushed the feat/filter-sort-backend branch from 041f482 to 297fcc2 Compare April 21, 2022 13:54
Copy link
Contributor

@SanderArntzen SanderArntzen left a comment

Choose a reason for hiding this comment

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

Nice jobs! Works as expected

@LiviaValenti LiviaValenti force-pushed the feat/filter-sort-backend branch from 297fcc2 to 8a1cbad Compare April 21, 2022 14:39
Copy link
Member Author

@Xtrah Xtrah left a comment

Choose a reason for hiding this comment

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

Amazeballs 🤩

@LiviaValenti LiviaValenti merged commit 2103feb into dev Apr 22, 2022
@LiviaValenti LiviaValenti deleted the feat/filter-sort-backend branch April 22, 2022 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend 🍑 Backend tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Backend for filter and sort
3 participants