feat: allow users and admins to cancel pending-approval requests

- Add cancel action to RequestActionsDropdown for admins
- Add cancel button to RequestCard for users
- Implement DELETE handler in /api/requests/[id] with:
  - Status gate: only cancellable if pending_approval or awaiting_approval
  - Clears selectedTorrent (Prisma.DbNull) on cancel
  - Fires on-grab notification job after cancel
- Tests: cancel flows for both statuses, rejection for non-cancellable status

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
xFlawless11x
2026-05-14 21:19:46 -04:00
parent 1711d256c2
commit 1a25f544b1
5 changed files with 115 additions and 7 deletions
+7
View File
@@ -77,6 +77,13 @@ export const NOTIFICATION_EVENTS = {
severity: 'error' as const,
priority: 'high' as const,
},
request_cancelled: {
label: 'Request Cancelled',
title: 'Request Cancelled',
emoji: '\u{1F6AB}',
severity: 'warning' as const,
priority: 'normal' as const,
},
issue_reported: {
label: 'Issue Reported',
title: 'Issue Reported',