diff options
Diffstat (limited to 'server/sonar-web/src/main/js/apps/quality-profiles/rename-profile-view.js')
-rw-r--r-- | server/sonar-web/src/main/js/apps/quality-profiles/rename-profile-view.js | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/rename-profile-view.js b/server/sonar-web/src/main/js/apps/quality-profiles/rename-profile-view.js index 4093cf3ff60..4e15d54fc6b 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/rename-profile-view.js +++ b/server/sonar-web/src/main/js/apps/quality-profiles/rename-profile-view.js @@ -24,29 +24,29 @@ import Template from './templates/quality-profiles-rename-profile.hbs'; export default ModalFormView.extend({ template: Template, - onFormSubmit: function () { + onFormSubmit () { ModalFormView.prototype.onFormSubmit.apply(this, arguments); this.sendRequest(); }, - sendRequest: function () { - var that = this, - url = '/api/qualityprofiles/rename', - name = this.$('#rename-profile-name').val(), - options = { - key: this.model.get('key'), - name: name - }; + sendRequest () { + const that = this; + const url = '/api/qualityprofiles/rename'; + const name = this.$('#rename-profile-name').val(); + const options = { + key: this.model.get('key'), + name + }; return $.ajax({ + url, type: 'POST', - url: url, data: options, statusCode: { // do not show global error 400: null } }).done(function () { - that.model.set({ name: name }); + that.model.set({ name }); that.destroy(); }).fail(function (jqXHR) { that.showErrors(jqXHR.responseJSON.errors, jqXHR.responseJSON.warnings); |