Police-Data-Accessibility-Project / data-sources-app

An API and UI for using and maintaining the Data Sources database
MIT License
4 stars 5 forks source link

Create endpoints for linking and unlinking Data Requests With Locations #505

Closed maxachis closed 2 weeks ago

maxachis commented 3 weeks ago

Context

Currently, in the /data-requests POST endpoint, we include a parameter for adding locations when creating an initial data request. However, we don't have means for adding or removing locations after initial creation. Let's amend that.

Requirements

  1. Add /data-requests/{resource_id}/related-locations GET, POST, and DELETE endpoints, for obtaining, adding, and removing locations, respectively, similar in behavior to our existing logic for /data-sources/{resource_id}/related-agencies
  2. Additionally, update /typeahead/locations to include the location id of a given location, for easy connection of a location id

Tests

Docs

Open questions

maxachis commented 3 weeks ago

@josh-chamberlain Do we want to be able to allow users to update their locations after creating their data requests?

josh-chamberlain commented 2 weeks ago

@maxachis yes, I think that's a good idea. That said, we don't have a UI for letting users edit their requests—so for now, the only people doing that would be those editing the requests via retool.

maxachis commented 2 weeks ago

@maxachis yes, I think that's a good idea. That said, we don't have a UI for letting users edit their requests—so for now, the only people doing that would be those editing the requests via retool.

In that case, (as you've already seen in Retool) we've resolved everything there is to resolve in this issue! 🎉