Pages corrections journal
This commit is contained in:
parent
d0e7ea0670
commit
8f082c08d4
@ -753,13 +753,15 @@ export default function CarnetPage() {
|
|||||||
throw new Error(`Failed to delete note: ${errorText}`);
|
throw new Error(`Failed to delete note: ${errorText}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Refresh the notes list
|
// Invalidate cache for this folder
|
||||||
const notesResponse = await fetch(`/api/storage/files?folder=${selectedFolder.toLowerCase()}`);
|
if (session?.user?.id) {
|
||||||
if (notesResponse.ok) {
|
invalidateFolderCache(session.user.id, selectedFolder);
|
||||||
const updatedNotes = await notesResponse.json();
|
|
||||||
setNotes(updatedNotes);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 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 the deleted note was selected, clear the selection
|
||||||
if (selectedNote?.id === note.id) {
|
if (selectedNote?.id === note.id) {
|
||||||
setSelectedNote(null);
|
setSelectedNote(null);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user