SchoolOfCode / bc17-w4d2-project-i-need-a-rest

bootcamp-17-bc17-w4d2-project-empty-repo created by GitHub Classroom
0 stars 0 forks source link

User Story 3: Implement functionality to GET all activities for a particular user #3

Closed faisalagood closed 3 months ago

faisalagood commented 3 months ago

Description:

As Kenny, a busy front end engineer I need to be able to send a PUT request with a JSON request body (the activity to update) to the API so that I can make a simple form that allows my user to edit an activity.

As Norman, a Tech Lead working across lots of projects I need to be able to depend on conventions like: the response object always containing a key called data or error, or the status code being an accurate indication of the success/failure (and reason) of the request.

Acceptance Criteria:

Given I am a developer who has the Activity API running, When I make a GET request to “http://localhost:3000/activities

Then the the request should succeed, responding with the correct status code and an array of User Activity objects in the response body (response.data).

### Tasks for User Story 3
- [x] Define User Activity Object somewhere
- [x] Create '/activities' GET route
- [x] Respond with correct status code (200)
- [x] Respond with reponse.body having an Array of User Acitivity Objects
- [x] Test criteria for /acitivties route and JSON response
faisalagood commented 3 months ago

Done.