mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-25 19:31:05 +00:00
Redirect to new pipeline (#1761)
Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
This commit is contained in:
parent
435f5ae207
commit
cfb53cb995
2 changed files with 9 additions and 5 deletions
|
@ -124,9 +124,9 @@ export default class WoodpeckerClient extends ApiClient {
|
|||
repo: string,
|
||||
pipeline: string,
|
||||
opts?: Record<string, string | number | boolean>,
|
||||
): Promise<unknown> {
|
||||
): Promise<Pipeline> {
|
||||
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<Pipeline>;
|
||||
}
|
||||
|
||||
getLogs(owner: string, repo: string, pipeline: number, step: number): Promise<PipelineLog[]> {
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue