From 41721ad5212d62cfa7ce9729b5bd27201e7992f2 Mon Sep 17 00:00:00 2001 From: Pouria Delfanazari Date: Fri, 5 Sep 2025 13:05:20 -0700 Subject: [PATCH] feat: remove unnecessary success notifications --- .../cards/components/addCardDrawer/AddCardDrawer.tsx | 3 --- .../createCollectionDrawer/CreateCollectionDrawer.tsx | 4 ---- .../deleteCollectionModal/DeleteCollectionModal.tsx | 3 --- .../components/editCollectionDrawer/EditCollectionDrawer.tsx | 5 ----- .../notes/components/editNoteDrawer/EditNoteDrawer.tsx | 5 ----- src/webapp/features/notes/lib/mutations/useUpdateNote.tsx | 2 ++ 6 files changed, 2 insertions(+), 20 deletions(-) diff --git a/src/webapp/features/cards/components/addCardDrawer/AddCardDrawer.tsx b/src/webapp/features/cards/components/addCardDrawer/AddCardDrawer.tsx index bd2ee79c..58a43381 100644 --- a/src/webapp/features/cards/components/addCardDrawer/AddCardDrawer.tsx +++ b/src/webapp/features/cards/components/addCardDrawer/AddCardDrawer.tsx @@ -58,9 +58,6 @@ export default function AddCardDrawer(props: Props) { }, { onSuccess: () => { - notifications.show({ - message: 'Added card.', - }); setSelectedCollections([]); props.onClose(); }, diff --git a/src/webapp/features/collections/components/createCollectionDrawer/CreateCollectionDrawer.tsx b/src/webapp/features/collections/components/createCollectionDrawer/CreateCollectionDrawer.tsx index 847d7291..05ae3786 100644 --- a/src/webapp/features/collections/components/createCollectionDrawer/CreateCollectionDrawer.tsx +++ b/src/webapp/features/collections/components/createCollectionDrawer/CreateCollectionDrawer.tsx @@ -42,10 +42,6 @@ export default function createCollectionDrawer(props: Props) { }, { onSuccess: (newCollection) => { - notifications.show({ - message: `Created collection "${form.getValues().name}".`, - }); - props.onClose(); props.onCreate && props.onCreate({ diff --git a/src/webapp/features/collections/components/deleteCollectionModal/DeleteCollectionModal.tsx b/src/webapp/features/collections/components/deleteCollectionModal/DeleteCollectionModal.tsx index 4dd7d988..ff7f599b 100644 --- a/src/webapp/features/collections/components/deleteCollectionModal/DeleteCollectionModal.tsx +++ b/src/webapp/features/collections/components/deleteCollectionModal/DeleteCollectionModal.tsx @@ -16,9 +16,6 @@ export default function DeleteCollectionModal(props: Props) { const handleDeleteCollection = () => { deleteCollection.mutate(props.collectionId, { onSuccess: () => { - notifications.show({ - message: 'Deleted collection.', - }); props.onClose(); router.push('/collections'); }, diff --git a/src/webapp/features/collections/components/editCollectionDrawer/EditCollectionDrawer.tsx b/src/webapp/features/collections/components/editCollectionDrawer/EditCollectionDrawer.tsx index cdc4ffac..73c7d03d 100644 --- a/src/webapp/features/collections/components/editCollectionDrawer/EditCollectionDrawer.tsx +++ b/src/webapp/features/collections/components/editCollectionDrawer/EditCollectionDrawer.tsx @@ -42,11 +42,6 @@ export default function EditCollectionDrawer(props: Props) { description: form.values.description, }, { - onSuccess: () => { - notifications.show({ - message: `Updated collection "${form.values.name}".`, - }); - }, onError: () => { notifications.show({ message: 'Could not update collection.', diff --git a/src/webapp/features/notes/components/editNoteDrawer/EditNoteDrawer.tsx b/src/webapp/features/notes/components/editNoteDrawer/EditNoteDrawer.tsx index cc254936..6833a768 100644 --- a/src/webapp/features/notes/components/editNoteDrawer/EditNoteDrawer.tsx +++ b/src/webapp/features/notes/components/editNoteDrawer/EditNoteDrawer.tsx @@ -37,11 +37,6 @@ export default function EditNoteDrawer(props: Props) { note: form.values.note, }, { - onSuccess: () => { - notifications.show({ - message: 'Updated note', - }); - }, onError: () => { notifications.show({ message: 'Could not update note.', diff --git a/src/webapp/features/notes/lib/mutations/useUpdateNote.tsx b/src/webapp/features/notes/lib/mutations/useUpdateNote.tsx index 716caeab..9cf0b0c9 100644 --- a/src/webapp/features/notes/lib/mutations/useUpdateNote.tsx +++ b/src/webapp/features/notes/lib/mutations/useUpdateNote.tsx @@ -17,6 +17,8 @@ export default function useUpdateNote() { onSuccess: (data) => { queryClient.invalidateQueries({ queryKey: ['card', data.cardId] }); + queryClient.invalidateQueries({ queryKey: ['collection'] }); + queryClient.invalidateQueries({ queryKey: ['collections'] }); }, }); -- 2.51.2