API Calls
- Fetch all reports:
fetchAllReports - Get a specific report:
fetchReportById - Take action on a report:
handleReportAction - Delete a report:
deleteReport - Get pending reports count:
getPendingReportsCount
API Documentation
1. Get All Reports
Endpoint:/reports
Method: GET
Description: Retrieves all reports with filtering options.
Query Parameters:
page: Number (pagination)limit: Number (pagination limit)reportType: String (blog,comment,user)status: String (pending,resolved)blockAuthor: String (yes,no)
2. Get a Specific Report
Endpoint:/reports/{reportId}
Method: GET
Description: Retrieves details of a specific report.
Response:
3. Take Action on a Report
Endpoint:/reports/{reportId}/action
Method: POST
Description: Performs an administrative action on a report.
Request Body:
delete_blog– Deletes the reported blog.block_author– Blocks the author of the content.resolve– Marks the report as resolved.
4. Delete a Report
Endpoint:/reports/{reportId}
Method: DELETE
Description: Deletes a report from the system.
Response:
5. Get Pending Reports Count
Endpoint:/reports/pending-count
Method: GET
Description: Retrieves the number of pending reports categorized by type.
Response:

