Spaces:
Sleeping
Sleeping
MichaelEdou Claude Opus 4.6 commited on
Commit ·
ec6d762
1
Parent(s): fe203ef
Preserve branches and AI settings on data reset
Browse filesReset now only clears transactions and scan logs. Branch config and
AI settings are no longer deleted when the user clicks Reset Data.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
packages/server/src/routes/settings.ts
CHANGED
|
@@ -136,13 +136,11 @@ router.get('/backup', requireAuth, async (_req: AuthRequest, res) => {
|
|
| 136 |
}
|
| 137 |
});
|
| 138 |
|
| 139 |
-
// POST /api/settings/reset — Delete all transactions
|
| 140 |
router.post('/reset', requireAuth, async (req: AuthRequest, res) => {
|
| 141 |
try {
|
| 142 |
db.delete(transactions).run();
|
| 143 |
db.delete(scanLogs).run();
|
| 144 |
-
db.delete(branchConfig).run();
|
| 145 |
-
db.delete(aiSettings).run();
|
| 146 |
|
| 147 |
// Clear in-memory caches
|
| 148 |
clearScanCaches();
|
|
|
|
| 136 |
}
|
| 137 |
});
|
| 138 |
|
| 139 |
+
// POST /api/settings/reset — Delete all transactions and scan logs (keeps users, branches, AI settings)
|
| 140 |
router.post('/reset', requireAuth, async (req: AuthRequest, res) => {
|
| 141 |
try {
|
| 142 |
db.delete(transactions).run();
|
| 143 |
db.delete(scanLogs).run();
|
|
|
|
|
|
|
| 144 |
|
| 145 |
// Clear in-memory caches
|
| 146 |
clearScanCaches();
|