Hi there,
Iâm trying to build a reputation system that will increment or decrement another users reputation based on the rating they give them. However, with the code below increment doesnât work. I console logged the data to make sure it was coming through correctly but it turns out that it wonât even query the user data at all, so of course the find wouldnât work. I added the master key to the find function but it still did nothing. Any suggestions?
const BuyerRateRepIncrease = async (buyer, rating) => {
const query = new Moralis.Query('_User');
// query.equalTo("ethAddress", buyer);
const results = await query.find();
console.log(buyer, query)
// if (rating == 1) {
// const repPointIncrement = results.decrement('reputation_points', 50)
// const repIncrement = results.decrement('reputation', 50)
// await repPointIncrement.save()
// await repIncrement.save()
(Iâve just commented out the code for now so thatâs why itâs presented like that)