Hi,
I’m trying to create a very basic cloud function trigger for my smart contract event, but it’s not working.
Just for testing, I trimmed everything, and kept the basic functionality, and it still does not work, not sure where exactly is the issue here:
Cloud function code:
Moralis.Cloud.beforeSave("EQuestionStatusNEW", (request) => {
const Question = Moralis.Object.extend("EQuestionNEW");
const query = new Moralis.Query(Question);
query.equalTo("questionId", 2);
const question = await query.first();
question.set("questionStatusId", 1); // this is not updated in collection
question.save();
});
EQuestionStatusNEW & EQuestionNEW are the collection names.
Can you please help resolve this.