Skip to content

Commit 6a9b4b2

Browse files
committed
Fix: add missing invalidation for snapshot list
This fixes an issues where after editing a repo, the snapshot list wasn't correctly updated.
1 parent e2d3966 commit 6a9b4b2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/services/Content/ContentQueries.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,7 @@ export const useEditContentQuery = (request: EditContentRequestItem) => {
311311

312312
queryClient.invalidateQueries(CONTENT_LIST_KEY);
313313
queryClient.invalidateQueries(CONTENT_ITEM_KEY);
314+
queryClient.invalidateQueries(LIST_SNAPSHOTS_KEY);
314315
queryClient.invalidateQueries(ADMIN_TASK_LIST_KEY);
315316
queryClient.invalidateQueries(POPULAR_REPOSITORIES_LIST_KEY);
316317
},
@@ -705,6 +706,7 @@ export const useTriggerSnapshot = (queryClient: QueryClient) => {
705706
title: 'Snapshot triggered successfully',
706707
id: 'trigger-snapshot-success',
707708
});
709+
queryClient.invalidateQueries(LIST_SNAPSHOTS_KEY);
708710
queryClient.invalidateQueries(CONTENT_LIST_KEY);
709711
},
710712
onError: (err) => {
@@ -767,6 +769,8 @@ export const useIntrospectRepositoryMutate = (
767769
id: 'introspect-repository-success',
768770
});
769771
}
772+
queryClient.invalidateQueries(CONTENT_ITEM_KEY);
773+
queryClient.invalidateQueries(LIST_SNAPSHOTS_KEY);
770774
queryClient.invalidateQueries(ADMIN_TASK_LIST_KEY);
771775
},
772776
// If the mutation fails, use the context returned from onMutate to roll back

0 commit comments

Comments
 (0)