Fix missing encoding of useBranch hook (#1798)

This commit is contained in:
Sebastian Sdorra
2021-09-08 07:45:41 +02:00
committed by GitHub
parent 059f1aeab0
commit 92fa67e937
4 changed files with 23 additions and 6 deletions

View File

@@ -43,7 +43,7 @@ export const useBranches = (repository: Repository): ApiResult<BranchCollection>
export const useBranch = (repository: Repository, name: string): ApiResult<Branch> => {
const link = requiredLink(repository, "branches");
return useQuery<Branch, Error>(branchQueryKey(repository, name), () =>
apiClient.get(concat(link, name)).then((response) => response.json())
apiClient.get(concat(link, encodeURIComponent(name))).then((response) => response.json())
);
};