Closed PhamelaMhlaba closed 1 month ago
Summary This issue introduces the following functionality for managing reviews:
Get all reviews.
Get a review by its ID.
Create a new review.
Update an existing review.
Delete a review.
Search reviews by rating and content.
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
Ensure all CRUD operations (create, read, update, delete) are working as expected.
Test search functionality for partial matches.
Test for error handling (404 not found, 500 server errors).
Example Endpoints
GET /reviews
GET /reviews/
POST /reviews
PUT /reviews/
DELETE /reviews/
GET /reviews/search?rating=5&content=great
Summary This issue introduces the following functionality for managing reviews:
Get all reviews.
Get a review by its ID.
Create a new review.
Update an existing review.
Delete a review.
Search reviews by rating and content.
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
Ensure all CRUD operations (create, read, update, delete) are working as expected.
Test search functionality for partial matches.
Test for error handling (404 not found, 500 server errors).
Example Endpoints
GET /reviews
GET /reviews/
POST /reviews
PUT /reviews/
DELETE /reviews/
GET /reviews/search?rating=5&content=great