COSC481W-2022Winter / capstone-hackmcx

capstone-hackmcx created by GitHub Classroom
0 stars 1 forks source link

Implement POST v1/posts to Create a Post #19

Closed zxkevin closed 2 years ago

zxkevin commented 2 years ago

As a content creator, I want to submit an image URL and a title so that it will show up on the frontpage and allow me to share my pictures with the world.

Acceptance Criteria:

Tasks:

3dxp commented 2 years ago

We have not yet implemented a model for posts to simplify the initial implementation of the endpoints.

If things get more complicated we may move to an ORM or build resource repositories.

3dxp commented 2 years ago

@sjiang1 Can we update the acceptance criteria for creating a successful post request? Right now we have:

When a request is made against the POST v1/post endpoint with a JSON request body with an image URL and a post title the created resource with the created ID is sent back to the client with a success status code.

We would like to update it to: "When a request is made against the POST v1/post endpoint with a JSON request body with an image URL and a post title the location of the created resource with the created ID is sent back to the client with a success status code."

Returning the created resource is less efficient in conditions where the client only needs to know the operation was successful and not what was created. The location of the created resource is included in the location header of the response so the client can retrieve the resource if needed.

The methodology described above is currently how the API is implemented in the project, we can change the API to return the created resource if that is what you prefer.

sjiang1 commented 2 years ago

@sjiang1 Can we update the acceptance criteria for creating a successful post request? Right now we have:

When a request is made against the POST v1/post endpoint with a JSON request body with an image URL and a post title the created resource with the created ID is sent back to the client with a success status code.

We would like to update it to: "When a request is made against the POST v1/post endpoint with a JSON request body with an image URL and a post title the location of the created resource with the created ID is sent back to the client with a success status code."

Yes, that's fine.