diff options
Diffstat (limited to 'server/sonar-web/src/main/js/apps/quality-gates/gate.js')
-rw-r--r-- | server/sonar-web/src/main/js/apps/quality-gates/gate.js | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/server/sonar-web/src/main/js/apps/quality-gates/gate.js b/server/sonar-web/src/main/js/apps/quality-gates/gate.js index 31c046b62bd..00ff3718d44 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/gate.js +++ b/server/sonar-web/src/main/js/apps/quality-gates/gate.js @@ -21,29 +21,29 @@ import Backbone from 'backbone'; export default Backbone.Model.extend({ - isDefault: function () { + isDefault () { return this.get('isDefault'); }, - url: function () { + url () { return '/api/qualitygates'; }, - showUrl: function () { + showUrl () { return this.url() + '/show'; }, - deleteUrl: function () { + deleteUrl () { return this.url() + '/destroy'; }, - toggleDefaultUrl: function () { - var method = this.isDefault() ? 'unset_default' : 'set_as_default'; + toggleDefaultUrl () { + const method = this.isDefault() ? 'unset_default' : 'set_as_default'; return this.url() + '/' + method; }, - sync: function (method, model, options) { - var opts = options || {}; + sync (method, model, options) { + const opts = options || {}; opts.data = opts.data || {}; opts.data.id = model.id; if (method === 'read') { @@ -56,9 +56,9 @@ export default Backbone.Model.extend({ return Backbone.ajax(opts); }, - toggleDefault: function () { - var that = this; - var opts = { + toggleDefault () { + const that = this; + const opts = { type: 'POST', url: this.toggleDefaultUrl(), data: { id: this.id } |