Skip to content

Commit 618bbce

Browse files
committed
fixup! fix repo param in url
1 parent 13569ac commit 618bbce

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

packages/hub/src/lib/create-branch.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ export async function createBranch(params: {
2929
*/
3030
overwrite?: boolean;
3131
}): Promise<void> {
32+
const repoId = toRepoId(params.repo);
3233
const res = await (params.fetch ?? fetch)(
33-
`${params.hubUrl ?? HUB_URL}/api/repos/${toRepoId(params.repo)}/branch/${encodeURIComponent(params.branch)}`,
34+
`${params.hubUrl ?? HUB_URL}/api/${repoId.type}s/${repoId.name}/branch/${encodeURIComponent(params.branch)}`,
3435
{
3536
method: "POST",
3637
headers: {

packages/hub/src/lib/delete-branch.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ export async function deleteBranch(params: {
1313
accessToken?: AccessToken;
1414
fetch?: typeof fetch;
1515
}): Promise<void> {
16+
const repoId = toRepoId(params.repo);
1617
const res = await (params.fetch ?? fetch)(
17-
`${params.hubUrl ?? HUB_URL}/api/repos/${toRepoId(params.repo)}/branch/${encodeURIComponent(params.branch)}`,
18+
`${params.hubUrl ?? HUB_URL}/api/${repoId.type}s/${repoId.name}/branch/${encodeURIComponent(params.branch)}`,
1819
{
1920
method: "DELETE",
2021
headers: {

0 commit comments

Comments
 (0)