resources filter by category #488
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
Problem
We currently use the category endpoint to serve resources by category (example category page). The issue with this endpoint is that it returns resources as groups of sub-categories, e.g.:
It's possible to have a resource listed under multiple sub-categories, as shown in the example above where "Resource A" provides both a meal and a food pantry.
This requires the client to filter out repeats of resources.
Solution
Ideally we'd like to have our current resources endpoint support filtering by category. That way, we can use one endpoint for fetching resources.
API Updates
categories
query param to the resources endpoint that accepts a string equaling a comma-separated list of categories we wish to filter resources by, e.g./resources?categories=food,shelter
Tech Notes
/resources
endpoint currently supports filtering resources by a list of comma-separated IDs. We'll need to make sure we also honor the current filtering byid
that exists on this endpoint. This means that if we provide bothids
andcategories
as filters, we only return resources that match the passed ids AND belong to one or more of the passed categories.The text was updated successfully, but these errors were encountered: