Pr 433#437
Conversation
|
@Benjtalkshow is attempting to deploy a commit to the Threadflow Team on Vercel. A member of the Team first needs to authorize it. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
Disabled knowledge base sources:
📝 WalkthroughWalkthroughThis change introduces differentiated deletion handling for hackathon drafts and published hackathons. A new Changes
Sequence DiagramsequenceDiagram
participant User
participant Page as Page Component
participant Hook as useDeleteHackathon
participant DraftAPI as Draft API
participant HackathonAPI as Hackathon API
User->>Page: Click delete (type: 'draft' or 'hackathon')
Page->>Page: Resolve title from data<br/>Populate hackathonToDelete with type
Page->>Page: Open confirmation dialog
User->>Page: Confirm deletion
Page->>Page: Capture title before clearing state
Page->>Hook: Call deleteHackathon({<br/>type, hackathonId, suppressToast})
alt type === 'draft'
Hook->>DraftAPI: DELETE /organizations/{id}/hackathons/draft/{id}
DraftAPI-->>Hook: 204 / error response
else type === 'hackathon'
Hook->>HackathonAPI: DELETE /hackathons/{id}
HackathonAPI-->>Hook: success / error response
end
Hook-->>Page: Return (isDeleting, error)
opt suppressToast = false
Hook->>User: Show success/error toast
end
Page->>User: Show success toast with captured title
Page->>Page: Refetch hackathons data
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
Possibly related PRs
Suggested reviewers
Poem
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Summary by CodeRabbit