Reputation: 52
I am calling a cloud code function with Parse js
Parse.Cloud.run('enterproductwithid',
{
"token": token,
"objId": objectIdOfCurrentProd,
"username": currentUser1.username
}
And my cloud code function is:
Parse.Cloud.define("enterproductwithid", function(request, response)
{
console.log(request.params);
});
Only the token parameter is passed. Nothing else logs. Any thoughts so I can stop pulling my hair out?!
Thanks!!
Upvotes: 0
Views: 2200
Reputation: 324
Do not put the parameter keys in quotes. It is similar to a $.ajax POST function.
Parse.Cloud.run('enterproductwithid',
{
token: token,
objId: objectIdOfCurrentProd,
username: currentUser1.username
},{
success: function(result) {
//do neat stuff
},
error: function(e) {
//error
}
});
Upvotes: 4