Last active
December 28, 2016 08:42
-
-
Save joevo2/5883bd0382189c5463e858a6d4a0741b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
validateCoupon = async (id) => { | |
let _this = this; | |
var Comments = Parse.Object.extend("Comments"); | |
var query = new Parse.Query(Comments); | |
query.equalTo("objectId", id); | |
await query.first({ | |
success: function (results) { | |
results.save(null, { | |
success: function (results) { | |
// Now let's update it with some new data. In this case, only cheatMode and score | |
// will get sent to the cloud. playerName hasn't changed. | |
results.set("coupon", true); | |
results.set("couponUsedDate", new Date()); | |
results.save(); | |
// alert('Validated'); | |
_this.getComments(); | |
} | |
}); | |
}, | |
error: function (error) { | |
alert("Error: " + error.code + " " + error.message); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment