diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-26 00:10:30 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-26 00:10:30 +0300 |
commit | 97cdd36a0b70b11e2592f3f63f7aca83342c8dfa (patch) | |
tree | 6169cbeea88584c9dfac8afa5ea4a6c6d7dd3206 /app/assets/javascripts/pipeline_new | |
parent | 2b349d9a94f00320a82e24be96ee8aeda9135702 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/pipeline_new')
-rw-r--r-- | app/assets/javascripts/pipeline_new/components/pipeline_new_form.vue | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/app/assets/javascripts/pipeline_new/components/pipeline_new_form.vue b/app/assets/javascripts/pipeline_new/components/pipeline_new_form.vue index e079603a5d4..ede8626607c 100644 --- a/app/assets/javascripts/pipeline_new/components/pipeline_new_form.vue +++ b/app/assets/javascripts/pipeline_new/components/pipeline_new_form.vue @@ -15,7 +15,7 @@ import { GlSprintf, } from '@gitlab/ui'; import { s__, __ } from '~/locale'; -import Api from '~/api'; +import axios from '~/lib/utils/axios_utils'; import { redirectTo } from '~/lib/utils/url_utility'; import { VARIABLE_TYPE, FILE_TYPE } from '../constants'; @@ -145,13 +145,17 @@ export default { ({ key, value }) => key !== '' && value !== '', ); - return Api.createPipeline(this.projectId, { - ref: this.refValue, - variables: filteredVariables, - }) - .then(({ data }) => redirectTo(data.web_url)) + return axios + .post(this.pipelinesPath, { + ref: this.refValue, + variables: filteredVariables, + }) + .then(({ data }) => { + redirectTo(`${this.pipelinesPath}/${data.id}`); + }) .catch(err => { - this.error = err.response.data.message.base; + const [message] = err.response.data.base; + this.error = message; }); }, }, |