mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 15:35:49 +01:00
Fix undefined check on branches details query hook
This commit is contained in:
@@ -95,7 +95,7 @@ export const useBranchDetailsCollection = (repository: Repository, branches: Bra
|
|||||||
>(
|
>(
|
||||||
branchQueryKey(repository, "details"),
|
branchQueryKey(repository, "details"),
|
||||||
({ pageParam = 0 }) => {
|
({ pageParam = 0 }) => {
|
||||||
const encodedBranches = chunks[pageParam].map(b => encodeURIComponent(b.name)).join("&branches=");
|
const encodedBranches = chunks[pageParam]?.map(b => encodeURIComponent(b.name)).join("&branches=");
|
||||||
return apiClient.get(concat(link, `?branches=${encodedBranches}`)).then(response => response.json());
|
return apiClient.get(concat(link, `?branches=${encodedBranches}`)).then(response => response.json());
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -113,7 +113,7 @@ export const useBranchDetailsCollection = (repository: Repository, branches: Bra
|
|||||||
}, [data, fetchNextPage]);
|
}, [data, fetchNextPage]);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
data: data?.pages.map(d => d._embedded?.branchDetails).flat(1),
|
data: data?.pages?.map(d => d._embedded?.branchDetails).flat(1),
|
||||||
isLoading,
|
isLoading,
|
||||||
error
|
error
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user