feat: add project deletion for rejected projects#204
Conversation
Implement delete functionality for rejected projects in admin panel. - Add DELETE API endpoint with cascade deletion of related records - Clean up blob storage images (cover, logo, team profiles) - Add confirmation dialog with warning about permanent deletion - Add delete button (trash icon) visible only to ADMIN users Closes IIT-SDGP#54
|
@Sithumli is attempting to deploy a commit to the Agzaiyenths's Projects Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Pull request overview
Implements an admin-only flow to permanently delete rejected projects, including database cleanup of related project records and attempting Azure Blob Storage cleanup for stored images. This supports issue #54 by enabling removal of rejected submissions and associated storage usage from the admin projects management UI.
Changes:
- Added a new admin DELETE API endpoint to delete a project and its related records, plus blob cleanup logic.
- Added a reusable
useDeleteProjecthook and aDeleteProjectDialogconfirmation dialog. - Extended the rejected projects table + admin projects page to expose and wire up a delete action for admins.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| hooks/project/useDeleteProject.ts | New hook to call the delete endpoint and manage loading/error/success state. |
| components/tables/RejectedProjectsTable.tsx | Adds optional delete action UI (trash button) for rejected projects. |
| components/dialogs/DeleteProjectDialog.tsx | New confirmation dialog describing irreversible deletion impact. |
| app/api/admin/projects/[projectId]/delete/route.ts | New server route to delete project data in Prisma and trigger blob deletion. |
| app/(admin)/admin/projects/page.tsx | Wires delete dialog + hook into rejected projects tab with toast feedback. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@Sithumli Please resolve the co-pilot comments first. |
|
@Sithumli we can't leave the delete api accessible to the public |
…o rejected projects
|
@agzaiyenth As requested I've addressed the comments and created a new PR #209 targeting the |
This PR implements the project deletion feature requested in issue #54, allowing administrators to permanently delete rejected projects and all associated data.
What changed
Why
Scope
Testing performed
Closes #54