High-Table-Consortium / fullstack-capstone-dockerized

0 stars 3 forks source link

Create Review Routes #53

Closed PhamelaMhlaba closed 1 month ago

PhamelaMhlaba commented 1 month ago

Summary This issue introduces the following functionality for managing reviews:

Details

Get All Reviews

GET /reviews: Fetches and returns all reviews from the database. Status: 200 on success, 500 on failure.

Get Review by ID

GET /reviews/ : Fetches a specific review by its ID. Status: 200 if found, 404 if not found, 500 on failure.

Create New Review

POST /reviews: Creates a new review with fields like content, rating, and user ID. Status: 201 on successful creation, 500 on failure.

Update Review

PUT /reviews/ : Updates an existing review with provided data. Status: 200 on success, 404 if not found, 500 on failure. Delete Review

DELETE /reviews/ : Deletes a review by its ID. Status: 200 on successful deletion, 404 if not found, 500 on failure.

Search Reviews

GET /reviews/search?rating=&content=: Filters reviews based on rating and content. Status: 200 on success, 500 on failure.

Testing

Example Endpoints