fix: invalidate trashed page from tree state
This commit is contained in:
parent
95b7be61df
commit
cb2a0398c7
1 changed files with 2 additions and 1 deletions
|
|
@ -126,8 +126,9 @@ export function useUpdatePageMutation() {
|
||||||
export function useRemovePageMutation() {
|
export function useRemovePageMutation() {
|
||||||
return useMutation({
|
return useMutation({
|
||||||
mutationFn: (pageId: string) => deletePage(pageId, false),
|
mutationFn: (pageId: string) => deletePage(pageId, false),
|
||||||
onSuccess: () => {
|
onSuccess: (_, pageId) => {
|
||||||
notifications.show({ message: "Page moved to trash" });
|
notifications.show({ message: "Page moved to trash" });
|
||||||
|
invalidateOnDeletePage(pageId);
|
||||||
queryClient.invalidateQueries({
|
queryClient.invalidateQueries({
|
||||||
predicate: (item) =>
|
predicate: (item) =>
|
||||||
["trash-list"].includes(item.queryKey[0] as string),
|
["trash-list"].includes(item.queryKey[0] as string),
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue