Fix pipeline cancel API endpoint and update Web and CLI clients (#1372)

Fixes #1369 

Co-authored-by: Anbraten <anton@ju60.de>
This commit is contained in:
Divya Jain
2022-10-30 19:09:01 +05:30
committed by GitHub
parent a5e1714039
commit 280d27d723
7 changed files with 15 additions and 19 deletions

View File

@@ -80,8 +80,8 @@ export default class WoodpeckerClient extends ApiClient {
return this._get(`/api/user/feed?${query}`) as Promise<PipelineFeed[]>;
}
cancelPipeline(owner: string, repo: string, number: number, ppid: number): Promise<unknown> {
return this._delete(`/api/repos/${owner}/${repo}/pipelines/${number}/${ppid}`);
cancelPipeline(owner: string, repo: string, number: number): Promise<unknown> {
return this._post(`/api/repos/${owner}/${repo}/pipelines/${number}/cancel`);
}
approvePipeline(owner: string, repo: string, pipeline: string): Promise<unknown> {

View File

@@ -156,7 +156,7 @@ export default defineComponent({
// throw new Error('Unexpected: Step not found');
// }
await apiClient.cancelPipeline(repo.value.owner, repo.value.name, parseInt(pipelineId.value, 10), 0);
await apiClient.cancelPipeline(repo.value.owner, repo.value.name, parseInt(pipelineId.value, 10));
notifications.notify({ title: i18n.t('repo.pipeline.actions.cancel_success'), type: 'success' });
});