@@ -128,26 +128,26 @@ export const taskBranchesKey = (projectId: string, taskId: string) =>
128128export async function getGitHubIntegration (
129129 api : PluginApiClient ,
130130) : Promise < GitHubIntegration > {
131- return api . pluginGet < GitHubIntegration > ( PLUGIN_ID , "/ github" ) ;
131+ return api . pluginGet < GitHubIntegration > ( PLUGIN_ID , `/projects/ ${ api . projectId } / github` ) ;
132132}
133133
134134export async function setGitHubToken (
135135 api : PluginApiClient ,
136136 token : string ,
137137) : Promise < GitHubIntegration > {
138- return api . pluginPost < GitHubIntegration > ( PLUGIN_ID , "/ github/token" , {
138+ return api . pluginPost < GitHubIntegration > ( PLUGIN_ID , `/projects/ ${ api . projectId } / github/token` , {
139139 token,
140140 } ) ;
141141}
142142
143143export async function deleteGitHubToken ( api : PluginApiClient ) : Promise < void > {
144- return api . pluginDelete ( PLUGIN_ID , "/ github/token" ) ;
144+ return api . pluginDelete ( PLUGIN_ID , `/projects/ ${ api . projectId } / github/token` ) ;
145145}
146146
147147export async function listAccessibleRepos (
148148 api : PluginApiClient ,
149149) : Promise < AccessibleRepo [ ] > {
150- return api . pluginGet < AccessibleRepo [ ] > ( PLUGIN_ID , "/ github/repositories" ) ;
150+ return api . pluginGet < AccessibleRepo [ ] > ( PLUGIN_ID , `/projects/ ${ api . projectId } / github/repositories` ) ;
151151}
152152
153153export async function linkRepository (
@@ -157,7 +157,7 @@ export async function linkRepository(
157157) : Promise < LinkedRepository > {
158158 return api . pluginPost < LinkedRepository > (
159159 PLUGIN_ID ,
160- "/ github/linked-repositories" ,
160+ `/projects/ ${ api . projectId } / github/linked-repositories` ,
161161 { owner, repo_name : repoName } ,
162162 ) ;
163163}
@@ -167,7 +167,7 @@ export async function listLinkedRepositories(
167167) : Promise < LinkedRepository [ ] > {
168168 return api . pluginGet < LinkedRepository [ ] > (
169169 PLUGIN_ID ,
170- "/ github/linked-repositories" ,
170+ `/projects/ ${ api . projectId } / github/linked-repositories` ,
171171 ) ;
172172}
173173
@@ -177,7 +177,7 @@ export async function unlinkRepository(
177177) : Promise < void > {
178178 return api . pluginDelete (
179179 PLUGIN_ID ,
180- `/github/linked-repositories/${ repoId } ` ,
180+ `/projects/ ${ api . projectId } / github/linked-repositories/${ repoId } ` ,
181181 ) ;
182182}
183183
@@ -187,7 +187,7 @@ export async function listTaskPRs(
187187) : Promise < PullRequest [ ] > {
188188 return api . pluginGet < PullRequest [ ] > (
189189 PLUGIN_ID ,
190- `/tasks/${ taskId } /github/pull-requests` ,
190+ `/projects/ ${ api . projectId } / tasks/${ taskId } /github/pull-requests` ,
191191 ) ;
192192}
193193
@@ -199,7 +199,7 @@ export async function linkPRToTask(
199199) : Promise < PullRequest > {
200200 return api . pluginPost < PullRequest > (
201201 PLUGIN_ID ,
202- `/tasks/${ taskId } /github/pull-requests` ,
202+ `/projects/ ${ api . projectId } / tasks/${ taskId } /github/pull-requests` ,
203203 { repo_id : repoId , pr_number : prNumber } ,
204204 ) ;
205205}
@@ -211,7 +211,7 @@ export async function unlinkPRFromTask(
211211) : Promise < void > {
212212 return api . pluginDelete (
213213 PLUGIN_ID ,
214- `/tasks/${ taskId } /github/pull-requests/${ prId } ` ,
214+ `/projects/ ${ api . projectId } / tasks/${ taskId } /github/pull-requests/${ prId } ` ,
215215 ) ;
216216}
217217
@@ -221,7 +221,7 @@ export async function listTaskBranches(
221221) : Promise < TaskBranch [ ] > {
222222 return api . pluginGet < TaskBranch [ ] > (
223223 PLUGIN_ID ,
224- `/tasks/${ taskId } /github/branches` ,
224+ `/projects/ ${ api . projectId } / tasks/${ taskId } /github/branches` ,
225225 ) ;
226226}
227227
@@ -234,7 +234,7 @@ export async function createBranch(
234234) : Promise < CreateBranchResult > {
235235 return api . pluginPost < CreateBranchResult > (
236236 PLUGIN_ID ,
237- `/tasks/${ taskId } /github/branches` ,
237+ `/projects/ ${ api . projectId } / tasks/${ taskId } /github/branches` ,
238238 { repo_id : repoId , branch_name : branchName , source_branch : sourceBranch } ,
239239 ) ;
240240}
0 commit comments