I am facing an issue in parse cloud code. The following is updating score and change date in my gamescore table. But it is not working. while I am doing same in my web code and it is working fine. Am I doing anything wrong here ?
'use strict';
var GameScore = Parse.Object.extend('GameScore');
Parse.Cloud.define('editScore', function(req, res) {
var query = new Parse.Query(GameScore);
query.get(req.params.objectId, {
success: function(gameScore) {
gameScore.set('score', req.params.score);
gameScore.set('date', req.params.date);
gameScore.save(null);
gameScore.fetch(myCallback);
},
error: function(err) {
return res.error(err);
}
});
});
If so then please help me so that I can make it working.