Tweet-311-Denver / tweet_311_denver_service

Backend for Tweet311Denver Turing Project
MIT License
1 stars 0 forks source link

Check for existing location before assigning a new one #39

Closed Dustin-Mikusko closed 4 years ago

Dustin-Mikusko commented 4 years ago

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, 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.

Issues

Closes #31

ap2322 commented 4 years ago

This looks good, but I've fetched the branch down and am working on testing this crucial POST /api/v1/reports endpoint