Skip to content

When the pages are deleted, the overview doesn't reflect the change. #581

Closed

Description

@omarNaifer12

General-Docmost-Personal-MicrosoftEdge2024-12-2223-51-21-ezgif com-video-to-gif-converter

Activity

  1. Philipinho commented on Dec 23, 2024

    @Philipinho
    Member

    Will have to invalidate the space recent-changes query key on page deletion.

    export function useRecentChangesQuery(
    spaceId?: string,
    ): UseQueryResult<IPagination<IPage>, Error> {
    return useQuery({
    queryKey: ["recent-changes", spaceId],
    queryFn: () => getRecentChanges(spaceId),
    refetchOnMount: true,
    });
    }

  2. omarNaifer12 commented on Dec 23, 2024

    @omarNaifer12
    ContributorAuthor

    Yes, that’s it. I’m wondering which approach has better performance: simply calling the API again or handling it manually? For example, we could store the ID of the deleted page in an atom and use useEffect to track when it’s not null. Then, we could use recursion to delete all its children. It seems a bit complex. What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions