So I ran into an issue with this code - it keeps giving me a message that says success/error was not called.
Parse.Cloud.beforeSave("Offer", function(request, response) {
var duplicationQuery = new Parse.Query("Offer");
console.log(duplicationQuery.count);
});
After that, I made some changes:
Parse.Cloud.beforeSave("Offer", function(request, response) {
var duplicationQuery = new Parse.Query("Offer");
duplicationQuery.count()
{
success: function(httpResponse) {
console.log(httpResponse.text);
response.success(httpResponse.text);
console.log("Row count: "+duplicationQuery.count);
},
error: function(httpResponse) {
console.error('Request failed with response code ' + httpResponse.status);
response.error('Request failed with response code ' + httpResponse.status);
}
}
});
It seems like there might be an issue with the syntax. Any helpful suggestions would be greatly appreciated!