diff --git a/web/src/lib/api/index.ts b/web/src/lib/api/index.ts index 544975a71..547c013ea 100644 --- a/web/src/lib/api/index.ts +++ b/web/src/lib/api/index.ts @@ -124,9 +124,9 @@ export default class WoodpeckerClient extends ApiClient { repo: string, pipeline: string, opts?: Record, - ): Promise { + ): Promise { const query = encodeQueryString(opts); - return this._post(`/api/repos/${owner}/${repo}/pipelines/${pipeline}?${query}`); + return this._post(`/api/repos/${owner}/${repo}/pipelines/${pipeline}?${query}`) as Promise; } getLogs(owner: string, repo: string, pipeline: number, step: number): Promise { diff --git a/web/src/views/repo/pipeline/PipelineWrapper.vue b/web/src/views/repo/pipeline/PipelineWrapper.vue index bc296f3df..6f365625c 100644 --- a/web/src/views/repo/pipeline/PipelineWrapper.vue +++ b/web/src/views/repo/pipeline/PipelineWrapper.vue @@ -161,10 +161,14 @@ const { doSubmit: restartPipeline, isLoading: isRestartingPipeline } = useAsyncA throw new Error('Unexpected: Repo is undefined'); } - await apiClient.restartPipeline(repo.value.owner, repo.value.name, pipelineId.value, { fork: true }); + const newPipeline = await apiClient.restartPipeline(repo.value.owner, repo.value.name, pipelineId.value, { + fork: true, + }); notifications.notify({ title: i18n.t('repo.pipeline.actions.restart_success'), type: 'success' }); - // TODO: directly send to newest pipeline? - await router.push({ name: 'repo', params: { repoName: repo.value.name, repoOwner: repo.value.owner } }); + await router.push({ + name: 'repo-pipeline', + params: { pipelineId: newPipeline.number }, + }); }); onMounted(loadPipeline);