Browse Source

add params.body default to client.prototype.request

pull/54/head
alexcreek 9 years ago
parent
commit
25faaa879a
2 changed files with 8 additions and 2 deletions
  1. +7
    -0
      lib/api/monitor.js
  2. +1
    -2
      lib/client.js

+ 7
- 0
lib/api/monitor.js View File

@ -237,6 +237,8 @@ function mute(monitorId, options, callback){
if(options.end){
params.body.end = parseInt(options.end);
}
} else {
params.body = ""; // create empty body
}
client.request("POST", util.format("/monitor/%s/mute"), params, callback);
}
@ -291,6 +293,11 @@ function unmute(monitorId, scope, callback){
params.body = {
scope: scope
};
<<<<<<< HEAD
=======
} else {
params.body = ""; // create empty body
>>>>>>> 5243bf7... add params.body default to client.prototype.request
}
client.request("POST", util.format("/monitor/%s/unmute", monitorId), params, callback);
}


+ 1
- 2
lib/client.js View File

@ -49,10 +49,9 @@ var client = function(){
client.prototype.request = function(method, path, params, callback){
if(arguments.length === 3 && typeof arguments[2] === "function"){
callback = arguments[2];
params = {};
params = {body: ''}; // create params with empty body property
}
params = params || {};
var body = (typeof params["body"] === "object") ? json.stringify(params["body"]) : params["body"];
var query = {
"api_key": this.api_key,


Loading…
Cancel
Save