mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-04 20:45:52 +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"),
|
||||
({ 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());
|
||||
},
|
||||
{
|
||||
@@ -113,7 +113,7 @@ export const useBranchDetailsCollection = (repository: Repository, branches: Bra
|
||||
}, [data, fetchNextPage]);
|
||||
|
||||
return {
|
||||
data: data?.pages.map(d => d._embedded?.branchDetails).flat(1),
|
||||
data: data?.pages?.map(d => d._embedded?.branchDetails).flat(1),
|
||||
isLoading,
|
||||
error
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user