Skip to content

Admin Dashboard (Approve, Delete, Deny) & Report Listing/User#84

Closed
jessmed749 wants to merge 8 commits intoLonghorn-Developers:mainfrom
jessmed749:main
Closed

Admin Dashboard (Approve, Delete, Deny) & Report Listing/User#84
jessmed749 wants to merge 8 commits intoLonghorn-Developers:mainfrom
jessmed749:main

Conversation

@jessmed749
Copy link
Contributor

1. Admin Dashboard for Approve, Delete & Deny

  • Listing Management - Approve/deny pending listings with reasons, delete reported content

2. Report User Feature

Report Listing

  • Report button on all listing pages
  • 7 predefined reasons (Spam, Scam, Inappropriate, Fake, Prohibited, Duplicate, Other)
  • Optional 500-char description
  • Success message: "Thanks for your report. Our team will review this listing shortly."

Report User

  • Available in profiles and chat windows
  • 7 predefined reasons (Harassment, Spam, Scammer, Fake Profile, Inappropriate, Impersonation, Other)
  • Optional description field
  • Success message: "Your report has been submitted. Thank you for helping keep UTMP safe."

Features:

  • Prevents duplicate reports
  • Prevents self-reporting
  • Stores reports in database for admin review

3. Secure Admin API Endpoints

Three production-ready endpoints with comprehensive security:

POST /api/admin/approve-listing

  • Approves pending listings
  • Sets status to 'approved'
  • Clears denial reasons

POST /api/admin/deny-listing

  • Denies listings with admin-provided reason
  • User can view reason and resubmit after edits

POST /api/admin/delete-listing

  • Removes reported listings with safe cascade delete
  • Delete order: favorites → reports → listing
  • Each step verified for errors

Security Features:

  • UUID format validation
  • Input type checking & length limits (reason < 500 chars)
  • Safe cascade deletes with error handling
  • Service role key for RLS bypass (server-only)

@jessmed749 jessmed749 closed this Mar 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant