day-cohort-70 / rare-api-rare-bear-team-4

rare-api-rare-bear-team-4 created by GitHub Classroom
0 stars 0 forks source link

update and delete functional #64

Closed novofeels closed 5 months ago

novofeels commented 5 months ago

Ticket:

33 and 34

What Changed:

update_post and delete_post function added to post.py, functions exported as package and called in do_PUT and do_DELETE respectively

Testing Steps:

first make sure you have a post object in your database with an id of 1.

test update_post by making a PUT request using postman to address http://localhost:8088/posts/1 ,

and in the body

{ "user_id": 1, "category_id": 2, "title": "awwwwwww shit its a test", "publication_date": "2024-05-29", "image_url": "http://example.com/image.jpg", "content": "Updated content of the post.", "approved": 1 }

check to see the title changed

to test delete make a DELETE request using postman to

http://localhost:8088/posts/1

make sure the the post with an id of 1 has been deleted