-
Notifications
You must be signed in to change notification settings - Fork 2
feat(moderation): Add delete action for hackathons and events in admin panel #355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…n panel - Add 'delete' action support to hackathon moderation endpoint alongside approve/reject - Implement permanent deletion of hackathons with cache invalidation - Update moderation queue to display both pending and deleted hackathons - Extend event moderation to include deleted events in retrieval - Add deletion capability to HackathonModerationQueue component UI - Update moderation service to filter by pending and deleted approval statuses - Refactor indentation and code formatting in moderation route handlers - Update type definitions to support delete action in moderation workflows - Enable admins to permanently remove flagged or problematic content from the platform
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. WalkthroughThis PR adds soft-delete functionality for events and hackathons with admin approval workflows. It introduces a Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant EventAPI as Event API<br/>(DELETE /[slug])
participant EventService as Events Service
participant DB as Database
participant AdminService as Admin Notifier
participant Cache as Cache
User->>EventAPI: DELETE request
EventAPI->>EventService: deleteEvent(id, userId)
alt Event is Approved
EventService->>DB: UPDATE approval_status to 'deleted'
DB-->>EventService: Success
EventService->>AdminService: Notify admins of soft-delete
EventService->>Cache: Invalidate cache
EventService-->>EventAPI: { soft_delete: true }
EventAPI-->>User: 200 + "Event marked for deletion.<br/>Admin approval required."
else Event is Draft/Pending
EventService->>DB: DELETE event record
DB-->>EventService: Success
EventService->>Cache: Invalidate cache
EventService-->>EventAPI: { soft_delete: false }
EventAPI-->>User: 200 + "Event deleted successfully"
end
sequenceDiagram
participant Admin
participant ModerationUI as Moderation UI
participant ModerationAPI as Moderation API<br/>(/admin/moderation)
participant HackathonAPI as Hackathon API
participant DB as Database
Admin->>ModerationUI: View pending hackathons
ModerationUI->>ModerationAPI: GET /admin/moderation/hackathons
ModerationAPI->>DB: Query status IN ('pending', 'deleted')
DB-->>ModerationAPI: Hackathons list
ModerationAPI-->>ModerationUI: Results
ModerationUI-->>Admin: Render with conditional actions
alt Hackathon status = 'deleted'
Admin->>ModerationUI: Click delete button
ModerationUI->>ModerationAPI: POST /admin/moderation/hackathons/[id]<br/>{ action: 'delete' }
ModerationAPI->>HackathonAPI: Trigger permanent delete
HackathonAPI->>DB: DELETE hackathon
DB-->>HackathonAPI: Success
HackathonAPI-->>ModerationAPI: Confirmed
ModerationAPI-->>ModerationUI: Success response
ModerationUI-->>Admin: Toast "Hackathon<br/>permanently deleted"
else Hackathon status = 'pending'
Admin->>ModerationUI: Click approve/reject
ModerationUI->>ModerationAPI: POST action
ModerationAPI-->>ModerationUI: Updated status
ModerationUI-->>Admin: Updated UI
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes
Possibly related PRs
Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (12)
Tip 📝 Customizable high-level summaries are now available in beta!You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.
Example instruction:
Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Authored by: @akshay0611
Summary by CodeRabbit
New Features
Chores
✏️ Tip: You can customize this high-level summary in your review settings.