Skip to content

Commit

Permalink
#17. Change Drupal.services.call to force switch the content type on …
Browse files Browse the repository at this point in the history
…comment update calls.
  • Loading branch information
signalpoint committed Feb 16, 2015
1 parent 03859ae commit 70734ae
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/services/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,14 @@ Drupal.services.call = function(options) {
contentType = 'application/x-www-form-urlencoded';
}
}
else if (method == 'PUT') { contentType = 'application/json'; }
else if (method == 'PUT') {
contentType = 'application/json';
// The comment update resource needs a url encoded data string.
if (options.service == 'comment' &&
options.resource == 'update') {
contentType = 'application/x-www-form-urlencoded';
}
}

// Anyone overriding the content type?
if (options.contentType) { contentType = options.contentType; }
Expand Down

0 comments on commit 70734ae

Please sign in to comment.