DELETE Request For Events - ActoKids/api GitHub Wiki

DELETE Event item from DynamoDB:

DELETE Example (THIS DEMO ONLY WORKS ONCE!): curl -v -H "Content-Type:application/json" -X DELETE https://utm0eolzl6.execute-api.us-west-2.amazonaws.com/v1/events/1

To view the code for the function got to this branch.

Things to consider moving forward:

  • The Primary Key in the db is the eventID maybe using node package UUID, and if we want the data sorted we may want to talk about using a sort key and what that key will be.

  • Deleting works and returns a status code 200 along with the deleted output for the user. These brings up the question, what to return to the client upon success, nothing?

  • For failure there are three responses in the Swagger file I have failed to implement as of yet. These are 400 for an invalid id, 404 for an event not found, and 500 for db connection problems. As of now I can get a 400 response but it goes to the response body so I need to find a way to map error status codes to the response header as a later task in the next sprint.

  • Also, I need to figure out how to set an api gateway model for the path parameter.