summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/repo
diff options
context:
space:
mode:
authorLuke "Jared" Bennett <lbennett@gitlab.com>2017-08-23 14:44:49 +0100
committerLuke "Jared" Bennett <lbennett@gitlab.com>2017-08-23 14:44:49 +0100
commit9eb28bbf218d8d7bfdfc0db4bc49e59004c847e0 (patch)
tree117e0099a0071abb4552a3d239cb2d8f6fad533e /app/assets/javascripts/repo
parentf3e4f10de22ce2cbbb5dd830b7dfe0a79f40d1c1 (diff)
downloadgitlab-ce-thenable-ajax-api-calls.tar.gz
Added repo_service_spec for commitFlash and corrected repo_commit-Secion api specthenable-ajax-api-calls
Diffstat (limited to 'app/assets/javascripts/repo')
-rw-r--r--app/assets/javascripts/repo/services/repo_service.js16
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);
+ }
},
};