Antonio-Maranhao commented on a change in pull request #1062: Remove JQuery 
usage from config addon
URL: https://github.com/apache/couchdb-fauxton/pull/1062#discussion_r173817446
 
 

 ##########
 File path: app/addons/config/resources.js
 ##########
 @@ -30,20 +31,20 @@ Config.OptionModel = Backbone.Model.extend({
   isNew () { return false; },
 
   sync (method, model) {
-
-    var params = {
-      url: model.url(),
-      contentType: 'application/json',
-      dataType: 'json',
-      data: JSON.stringify(model.get('value'))
-    };
-
+    let operation = put;
     if (method === 'delete') {
-      params.type = 'DELETE';
-    } else {
-      params.type = 'PUT';
+      operation = deleteRequest;
     }
-    return $.ajax(params);
+
+    return operation(
+      model.url(),
+      model.get('value')
 
 Review comment:
   Good catch. I changed the code since the body is not needed for the DELETE 
request.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to