diff options
author | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-08-23 14:44:49 +0100 |
---|---|---|
committer | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-08-23 14:44:49 +0100 |
commit | 9eb28bbf218d8d7bfdfc0db4bc49e59004c847e0 (patch) | |
tree | 117e0099a0071abb4552a3d239cb2d8f6fad533e /app/assets | |
parent | f3e4f10de22ce2cbbb5dd830b7dfe0a79f40d1c1 (diff) | |
download | gitlab-ce-9eb28bbf218d8d7bfdfc0db4bc49e59004c847e0.tar.gz |
Added repo_service_spec for commitFlash and corrected repo_commit-Secion api specthenable-ajax-api-calls
Diffstat (limited to 'app/assets')
-rw-r--r-- | app/assets/javascripts/repo/services/repo_service.js | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/app/assets/javascripts/repo/services/repo_service.js b/app/assets/javascripts/repo/services/repo_service.js index a8a4b419ae8..af83497fa39 100644 --- a/app/assets/javascripts/repo/services/repo_service.js +++ b/app/assets/javascripts/repo/services/repo_service.js @@ -67,13 +67,15 @@ 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(this.commitFlash); + }, + + commitFlash(data) { + if (data.short_id && data.stats) { + window.Flash(`Your changes have been committed. Commit ${data.short_id} with ${data.stats.additions} additions, ${data.stats.deletions} deletions.`, 'notice'); + } else { + window.Flash(data.message); + } }, }; |