Pages corrections journal

This commit is contained in:
alma 2026-01-16 13:09:47 +01:00
parent d0e7ea0670
commit 8f082c08d4

View File

@ -753,13 +753,15 @@ export default function CarnetPage() {
throw new Error(`Failed to delete note: ${errorText}`);
}
// Refresh the notes list
const notesResponse = await fetch(`/api/storage/files?folder=${selectedFolder.toLowerCase()}`);
if (notesResponse.ok) {
const updatedNotes = await notesResponse.json();
setNotes(updatedNotes);
// Invalidate cache for this folder
if (session?.user?.id) {
invalidateFolderCache(session.user.id, selectedFolder);
}
// Refresh the notes list using fetchNotes to ensure proper mapping
// This ensures titles are correctly formatted for all folders
await fetchNotes(true);
// If the deleted note was selected, clear the selection
if (selectedNote?.id === note.id) {
setSelectedNote(null);