API Calls
- Fetch paginated comments:
fetchPaginatedComments - Fetch total comment count:
fetchTotalComments - Search comments:
searchComments - Delete a comment:
deleteComment - Delete multiple comments:
deleteManyComments
API Documentation
1. Get Paginated Comments
Endpoint:/admin/comments
Method: GET
Description: Retrieves a paginated list of comments with filtering and sorting options.
Request Parameters:
2. Get Total Comment Count
Endpoint:/admin/comments/count
Method: GET
Description: Retrieves the total count of all comments on the platform.
Response:
3. Search Comments
Endpoint:/admin/comments
Method: GET
Description: Searches comments by content.
Request Parameters:
4. Delete a Comment
Endpoint:/admin/comments/{id}
Method: DELETE
Description: Deletes a single comment by its ID.
Response:
5. Delete Multiple Comments
Endpoint:/admin/comments/deleteMany
Method: POST
Description: Deletes multiple comments by their IDs.
Request Body:
Usage Flow
- The admin accesses the Comments Management page.
- The component fetches paginated comment data from
/admin/comments. - The admin can search for comments by entering a query.
- The admin can delete a single comment by clicking the delete button, triggering a request to
/admin/comments/{id}. - The admin can bulk delete comments by selecting multiple entries and triggering
/admin/comments/deleteMany. - A toast notification confirms success or failure of deletion.
Error Handling
- Invalid comment ID: Returns
404 Not Found - Unauthorized request: Returns
403 Forbidden - Server errors: Returns
500 Internal Server Error

