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

resources filter by sub-category #489

Open
jacobvenable opened this issue Aug 31, 2021 · 0 comments
Open

resources filter by sub-category #489

jacobvenable opened this issue Aug 31, 2021 · 0 comments
Labels
Project: Server Related to the server workspace Project: Web Related to the web workspace sorting and filtering ✅ Status: Dev Ready This is waiting to be started

Comments

@jacobvenable
Copy link
Member

Problem

We currently use the sub-category endpoint to serve resources by category (example sub-category page). After we tackle #488, we'll be accessing lists of resources in the web project from two separate endpoints.

It'd be ideal to standardize how we access resources.

Solution

Ideally we'd like to have our current resources endpoint support filtering by sub-category. That way, we can use one endpoint for fetching resources.

API Updates

  • add an optional subcategories query param to the resources endpoint that accepts a string equaling a comma-separated list of subcategories we wish to filter resources by, e.g. /resources?subcategories=emergency,family
  • update the useResourcesBySubcategory hook to consume resources using that updated endpoint

Tech Notes

  • The current /resources endpoint currently supports filtering resources by a list of comma-separated IDs and possibly categories due to resources filter by category #488 if that is completed before. We'll need to make sure we also honor the current filtering by ids and categories that exists on this endpoint. This means that if we provide both ids and categories and subcategories as filters, we only return resources that match the passed ids AND belong to one or more of the passed categories AND belong to one or more of the passed subcategories.
@jacobvenable jacobvenable added Project: Server Related to the server workspace Project: Web Related to the web workspace sorting and filtering ✅ Status: Dev Ready This is waiting to be started labels Aug 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Project: Server Related to the server workspace Project: Web Related to the web workspace sorting and filtering ✅ Status: Dev Ready This is waiting to be started
Projects
None yet
Development

No branches or pull requests

1 participant