Tweet-311-Denver / tweet_311_denver_service

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

Client can POST to /api/v1/reports #15

Open ap2322 opened 4 years ago

ap2322 commented 4 years ago

Client can sent a request to post /api/v1/reports with a json payload and the location is checked in the database and a report is made in the db.

Example Request:

POST /api/v1/reports
payload: 
{.  report: {
        category: this.state.isSnowRemoval ? ‘snow_removal’ : ‘other’,
        description: this.state.description,
        image: this.state.images,
        email: this.state.email
      },
      location: {
        lat: ‘’,
        lon: ‘’
      }
    }

Example response (iteration 1)

HTTP Status 201 Created
body:
{ message: "Success, your report has been created"}

Endpoint functions:

Future iterations