I want to send a data attribute to an API server only if the method is add
, if it's delete
, I don't don't want to send my data.
I have
var body =
{
id: 1,
method: method,
params: [
{
data: {
"key1" : "value1",
"key2" : "value2",
"key3" : "value3"
},
url: `/url/anything`
}
],
session: session,
verbose: 1
};
I tried
if(method == 'delete') {
_.pick(body.params[0], ['data']);
}
I also tried
if(method == 'delete') {
_.pick(body.params[0],'data');
}
For some reason, I still see that I still sending the data
.
How would one go about debugging this?