diff options
author | Mike Greiling <mike@pixelcog.com> | 2017-08-17 13:05:09 -0500 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2017-08-17 16:06:42 -0500 |
commit | cdd741ee22b3d02ea75fa4021497f80867c09f39 (patch) | |
tree | 6b8c6fffb14ec17ba2a6e9307ffeaa9acc448a45 /app/assets/javascripts | |
parent | 725a4fef5aeea02bea3f943133d075177424117d (diff) | |
download | gitlab-ce-cdd741ee22b3d02ea75fa4021497f80867c09f39.tar.gz |
fix eslint violations in repo editor files
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r-- | app/assets/javascripts/api.js | 3 | ||||
-rw-r--r-- | app/assets/javascripts/repo/components/repo_commit_section.vue | 5 | ||||
-rw-r--r-- | app/assets/javascripts/repo/services/repo_service.js | 14 |
3 files changed, 12 insertions, 10 deletions
diff --git a/app/assets/javascripts/api.js b/app/assets/javascripts/api.js index 28119362455..4319bfcc57f 100644 --- a/app/assets/javascripts/api.js +++ b/app/assets/javascripts/api.js @@ -96,7 +96,8 @@ const Api = { .done(projects => callback(projects)); }, - commitMultiple(id, data, callback) { + commitMultiple(id, data) { + // see https://docs.gitlab.com/ce/api/commits.html#create-a-commit-with-multiple-files-and-actions const url = Api.buildUrl(Api.commitPath) .replace(':id', id); return this.wrapAjaxCall({ diff --git a/app/assets/javascripts/repo/components/repo_commit_section.vue b/app/assets/javascripts/repo/components/repo_commit_section.vue index d06cdf2cbc2..1282828b504 100644 --- a/app/assets/javascripts/repo/components/repo_commit_section.vue +++ b/app/assets/javascripts/repo/components/repo_commit_section.vue @@ -43,10 +43,11 @@ export default { }; Store.submitCommitsLoading = true; Service.commitFiles(payload) - .then(this.resetCommitState); + .then(this.resetCommitState) + .catch(() => Flash('An error occured while committing your changes')); }, - resetCommitState(data) { + resetCommitState() { this.submitCommitsLoading = false; this.changedFiles = []; this.commitMessage = ''; diff --git a/app/assets/javascripts/repo/services/repo_service.js b/app/assets/javascripts/repo/services/repo_service.js index 310c03fc019..a8a4b419ae8 100644 --- a/app/assets/javascripts/repo/services/repo_service.js +++ b/app/assets/javascripts/repo/services/repo_service.js @@ -67,13 +67,13 @@ const RepoService = { commitFiles(payload) { return Api.commitMultiple(Store.projectId, payload) - .then((data) => { - if (data.short_id && data.stats) { - Flash(`Your changes have been committed. Commit ${data.short_id} with ${data.stats.additions} additions, ${data.stats.deletions} deletions.`, 'notice'); - } else { - Flash(data.message); - } - }); + .then((data) => { + if (data.short_id && data.stats) { + Flash(`Your changes have been committed. Commit ${data.short_id} with ${data.stats.additions} additions, ${data.stats.deletions} deletions.`, 'notice'); + } else { + Flash(data.message); + } + }); }, }; |