Conversation
|
@vansh-commits is attempting to deploy a commit to the Unkey Team on Vercel. A member of the Team first needs to authorize it. |
📝 WalkthroughWalkthroughAdds end-to-end project deletion: a frontend DeleteProject component and useDeleteProject hook, and updates the server deleteProject procedure to enforce rate limits, validate deleteProtection, cascade-delete related entities, improve error handling, and change the return payload to { projectId }. Changes
Sequence DiagramsequenceDiagram
participant User
participant DeleteProject as DeleteProject<br/>Component
participant Hook as useDeleteProject<br/>Hook
participant TRPC as TRPC Router
participant DB as Database
participant Toast as Toast Service
User->>DeleteProject: Open dialog / check confirmation
User->>DeleteProject: Click Confirm Delete
DeleteProject->>Hook: invoke delete mutation(projectId)
Hook->>TRPC: call deleteProject RPC
TRPC->>TRPC: enforce rate limit
TRPC->>DB: fetch project (id,name,deleteProtection)
DB-->>TRPC: project row
TRPC->>TRPC: verify not delete-protected
TRPC->>DB: delete related entities (policies, bindings, instances, sentinels, routes, domains, repo connections, deployments, env-scoped settings, environments)
DB-->>TRPC: deletions complete
TRPC->>TRPC: write audit log, return {projectId}
TRPC-->>Hook: {projectId}
Hook->>Toast: show success toast
Hook->>DeleteProject: call onSuccess (close dialog)
DeleteProject->>User: dialog closed
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 🧹 Recent nitpick comments
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 |
There was a problem hiding this comment.
Pull request overview
This PR fixes project deletion from the projects list by wiring the “Delete project” action to a new client-side delete flow and updating the backend delete mutation.
Changes:
- Update the
deploy.project.deletetRPC mutation to perform a more comprehensive delete transaction and improve error handling. - Replace the previous delete dialog usage with a new
DeleteProjectaction component anduseDeleteProjectmutation hook. - Add client-side cache invalidation/collection cleanup and user-facing toasts for delete success/failure.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
web/apps/dashboard/lib/trpc/routers/deploy/project/delete.ts |
Updates server-side delete mutation logic, rate limiting, and error handling. |
web/apps/dashboard/app/(app)/[workspaceSlug]/projects/_components/list/use-delete-project.ts |
Adds a client hook to call the delete mutation and handle cache cleanup + toasts. |
web/apps/dashboard/app/(app)/[workspaceSlug]/projects/_components/list/project-actions.tsx |
Wires the “Delete project” action to the new delete component. |
web/apps/dashboard/app/(app)/[workspaceSlug]/projects/_components/list/delete-project.tsx |
Adds the new delete dialog + confirm popover UI for project deletion. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Sorry for the inconvenience but this fixed by core members. We forgot to tag that issue as "core", thats what caused this confusion. Sorry again, thank you for your efforts tho. |
|
no, issues..., |
What does this PR do?
"On project cards, the Delete button does not perform any action when clicked.", fixed, delete button now works
Fixes #4916
Type of change
How should this be tested?
Checklist
pnpm buildpnpm fmtconsole.logsgit pull origin main