mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-08 14:35:45 +01:00
2
gradle/changelog/branch_details_invalidation.yaml
Normal file
2
gradle/changelog/branch_details_invalidation.yaml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
- type: fixed
|
||||||
|
description: Branch details invalidation ([#1973](https://github.com/scm-manager/scm-manager/pull/1973))
|
||||||
@@ -47,7 +47,7 @@ export const useBranches = (repository: Repository): ApiResult<BranchCollection>
|
|||||||
() => apiClient.get(link).then(response => response.json()),
|
() => apiClient.get(link).then(response => response.json()),
|
||||||
{
|
{
|
||||||
onSuccess: () => {
|
onSuccess: () => {
|
||||||
return queryClient.invalidateQueries(branchQueryKey(repository, "details"));
|
return queryClient.invalidateQueries(branchDetailsQueryKey(repository));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// we do not populate the cache for a single branch,
|
// we do not populate the cache for a single branch,
|
||||||
@@ -79,10 +79,7 @@ function chunkBranches(branches: Branch[]) {
|
|||||||
return chunks;
|
return chunks;
|
||||||
}
|
}
|
||||||
|
|
||||||
const branchDetailsQueryKey = (
|
const branchDetailsQueryKey = (repository: NamespaceAndName, branch: string | undefined = undefined) => {
|
||||||
repository: NamespaceAndName,
|
|
||||||
branch: string | undefined = undefined
|
|
||||||
) => {
|
|
||||||
let branchName;
|
let branchName;
|
||||||
if (!branch) {
|
if (!branch) {
|
||||||
branchName = "_";
|
branchName = "_";
|
||||||
|
|||||||
Reference in New Issue
Block a user