File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff 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 : {
Original file line number Diff line number Diff 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 : {
You can’t perform that action at this time.
0 commit comments