civictechdc/us-congress-pizza-flag-tracker-frontend

(Ananda) UI: Add query by status, state, and office

Closed this issue · 4 comments

Each needs an LOV (List of values), so separate query fields needed for each

  • UI that alters the query params,
  • fetch to backend from the query params /api/orders?...

FROM BELOW:
Suggestion is to use query params in the URL to send up to 5 params to the backend route (something like frontend's /search?keyword=XXX&usa_state=XX&office=XX&status=XXXX&active=true - this url could be bookmarked by a user to save such a search). There will always only ever be 0 or 1 values for each parameter (we don't need the functionality of searching for orders from MD OR VA)

similarly on the backend use /api/orders?keyword=XXX&usa_state=XX&office=XX&status=XXXX&active=true as an alternative fetch from the frontend to the backend using the query parameters specified above.
https://github.com/codefordc/us-congress-pizza-flag-tracker-frontend/blob/356a6bc08e782bf4f9ac2426fc26466af3204a73/src/service/orderService.js#L10

existing search API: /api/order_num/10

We looked at one example of detailed sort (Carvana) and liked it. Something like this with multi-selects that pop open?

Screen Shot 2022-05-18 at 8 20 48 PM

https://react-select.com/home

Idea would be to leave existing search bar as is but make it search all fields instead of just order ID.

Suggestion is to use query params in the URL to send up to 5 params to the backend route (something like search?keyword=XXX&usa_state=XX&office=XX&status=XXXX&active=true - this url could be bookmarked by a user to save such a search). There will always only ever be 0 or 1 values for each parameter (we don't need the functionality of searching for orders from MD OR VA)

similarly on the backend use /api/orders?keyword=XXX&usa_state=XX&office=XX&status=XXXX&active=true as an alternative fetch from the frontend to the backend using the query parameters specified above.
https://github.com/codefordc/us-congress-pizza-flag-tracker-frontend/blob/356a6bc08e782bf4f9ac2426fc26466af3204a73/src/service/orderService.js#L10

existing search API: /api/order_num/10

this is closed by #113 and #119 I believe?