feat: add project reset with confirmation to general settings by lunenas · Pull Request #135 · ycode/ycode
Summary
Add a working "Reset project" button in the general settings danger zone that resets the database via the existing devtools API, with a confirmation dialog to prevent accidental data loss.
Changes
- Wire up the "Reset project" button to open a confirmation dialog
- Add confirmation dialog warning that the action is permanent and cannot be undone
- Call
POST /ycode/api/devtools/reset-dbon confirm, with loading state and error handling via toast - Redirect to
/ycodeon successful reset
Test plan
- Navigate to Settings → General → Website tab, scroll to "Danger zone"
- Click "Reset project" — confirmation dialog should appear
- Click "Cancel" — dialog should close, nothing happens
- Click "Reset project" in dialog — should show spinner, reset the database, and redirect to
/ycode - Verify error toast appears if the API call fails (e.g. network error)
Made with Cursor
Wire up the "Reset project" button in the danger zone section to call the existing reset-db API endpoint, gated behind a confirmation dialog that warns the action cannot be undone. Made-with: Cursor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters