diff --git a/Client/src/pages/FilterNotes.jsx b/Client/src/pages/FilterNotes.jsx index 1803cab..97564ed 100644 --- a/Client/src/pages/FilterNotes.jsx +++ b/Client/src/pages/FilterNotes.jsx @@ -103,17 +103,17 @@ function FilterNotes() { subjectsForYear.map((note) => (
{note.subject} -

+

{note.author}

diff --git a/Client/src/pages/delete.jsx b/Client/src/pages/delete.jsx index 0cbd1e0..1187383 100644 --- a/Client/src/pages/delete.jsx +++ b/Client/src/pages/delete.jsx @@ -55,7 +55,9 @@ const DeleteNote = () => { try { const response = await fetch(`https://scholarstation.onrender.com/notes/${id}`, { method: 'DELETE' }); if (!response.ok) throw new Error("Error deleting note."); - setNotes(notes.filter(note => note.id !== id)); + + // After deletion, update the notes state by filtering out the deleted note + setNotes(prevNotes => prevNotes.filter(note => note.id !== id)); } catch (err) { setError("Error deleting note."); console.error(err);