fix: exclude trashed notes from notebook counts + wire up trash restore/delete
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 39s

- Add trashedAt: null filter to notebook note count queries in /api/notebooks
- Pass isTrashView, onRestore, onPermanentDelete from NoteCard to NoteActions
- Implement handleRestore and handlePermanentDelete in NoteCard

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-04-26 10:04:06 +02:00
parent e83f1d1e52
commit dc18dc3de4
2 changed files with 34 additions and 3 deletions

View File

@@ -21,7 +21,7 @@ export async function GET(request: NextRequest) {
orderBy: { name: 'asc' }
},
_count: {
select: { notes: { where: { isArchived: false } } }
select: { notes: { where: { isArchived: false, trashedAt: null } } }
}
},
orderBy: { order: 'asc' }
@@ -82,7 +82,7 @@ export async function POST(request: NextRequest) {
include: {
labels: true,
_count: {
select: { notes: { where: { isArchived: false } } }
select: { notes: { where: { isArchived: false, trashedAt: null } } }
}
}
})