diff --git a/gradle/changelog/branch_details_invalidation.yaml b/gradle/changelog/branch_details_invalidation.yaml new file mode 100644 index 0000000000..50fea47b9e --- /dev/null +++ b/gradle/changelog/branch_details_invalidation.yaml @@ -0,0 +1,2 @@ +- type: fixed + description: Branch details invalidation ([#1973](https://github.com/scm-manager/scm-manager/pull/1973)) diff --git a/scm-ui/ui-api/src/branches.ts b/scm-ui/ui-api/src/branches.ts index a371b4109f..c815c5b826 100644 --- a/scm-ui/ui-api/src/branches.ts +++ b/scm-ui/ui-api/src/branches.ts @@ -47,7 +47,7 @@ export const useBranches = (repository: Repository): ApiResult () => apiClient.get(link).then(response => response.json()), { onSuccess: () => { - return queryClient.invalidateQueries(branchQueryKey(repository, "details")); + return queryClient.invalidateQueries(branchDetailsQueryKey(repository)); } } // we do not populate the cache for a single branch, @@ -79,10 +79,7 @@ function chunkBranches(branches: Branch[]) { return chunks; } -const branchDetailsQueryKey = ( - repository: NamespaceAndName, - branch: string | undefined = undefined -) => { +const branchDetailsQueryKey = (repository: NamespaceAndName, branch: string | undefined = undefined) => { let branchName; if (!branch) { branchName = "_";