You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Implements ticket 6c5904 — five admin-authenticated endpoints for moderation workflows: GET /api/admin/reports paginated list of reported quotes GET /api/admin/reports/:id full quote + all report rows DELETE /api/admin/reports/:id/quote unconditionally delete a quote POST /api/admin/reports/:id/hide set hidden=1 on a quote DELETE /api/admin/reports/:id/reports clear all reports for a quote All endpoints require X-Admin-Code header; 403 on missing/wrong code. DB layer additions: - QuoteRepository trait gains list_reports, get_reports_for_quote, admin_delete_quote, hide_quote, and clear_reports methods - New ReportRow, ReportSummary, ReportListResult, and QuoteReports types added to db/mod.rs - Implementations in native.rs (rusqlite) and d1.rs (Cloudflare D1) Tests added: - 14 unit handler tests using MockRepo (3 per endpoint covering success, 404, and 403 cases) - 5 integration tests using real SQLite via NativeRepository - 10 DB-layer unit tests in native.rs Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> |
3 months ago | |
|---|---|---|
| .. | ||
| mod.rs | 3 months ago | |