This PR adds in functionality in the POST /api/v1/reports endpoint to check that the location submitted doesn't already exist in the database. If it does, that location_id is used as the location for the new report. This avoids creating multiple IDs for the same location.
Where should the reviewer start?
In routes.js and reports.js I've added this functionality to the POST endpoint and to the new TEST endpoint.
What does this PR do?
This PR adds in functionality in the POST
/api/v1/reports
endpoint to check that the location submitted doesn't already exist in the database. If it does, thatlocation_id
is used as the location for the new report. This avoids creating multiple IDs for the same location.Where should the reviewer start?
In
routes.js
andreports.js
I've added this functionality to the POST endpoint and to the new TEST endpoint.Issues
Closes #31