mirror of
https://github.com/docmost/docmost.git
synced 2026-05-07 06:23:06 +08:00
fix: invalidate trashed page from tree state
This commit is contained in:
@@ -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),
|
||||||
|
|||||||
Reference in New Issue
Block a user