Reputation: 2438
I'm trying to set a default value to a variable using cloud code. The code I'm running is:
Parse.Cloud.beforeSave("Parse.User", function(request, response) {
if (!request.object.get("score")) {
request.object.set("score", 60.0);
}
response.success();
});
When I run parse deploy
, I'm getting Update failed with internal error
. Is there something I'm doing wrong?
Upvotes: 0
Views: 98
Reputation: 9952
Remove quotes from "Parse.User":
Parse.Cloud.beforeSave(Parse.User, function(request, response) {
if (!request.object.get("score")) {
request.object.set("score", 60.0);
}
response.success();
});
Upvotes: 2