my moralis object has the following methods
setStatus: function(newStatus) {
console.log("status run");
this.set("status", newStatus);
this.save().then(
(obj) => {
// Execute any logic that should take place after the object is saved.
alert("New object created with objectid: " + obj.id);
},
(error) => {
// Execute any logic that should take place if the save fails.
// error is a Moralis.Error with an error code and message.
alert("Failed to create new object, with error code: " + error.message);
}
);
},
removeBuyerId: function() {
this.set("buyerId", "nil");
this.save();
},
it works here
const order = () => {
buyerOrder()
.then((reply) => {
console.log(reply.getHash().hash);
obj.setStatus("In Order");
obj.setBuyerId(user.id);
})
.catch((err) => {
console.log(err);
});
};
but not here even though it seemingly the same code
const claim = () => {
sellerClaim()
.then((reply) => {
console.log(reply.getHash().hash);
obj.setStatus("Open");
obj.removeBuyerId();
})
.catch((err) => {
console.log(err);
});
};
in the first case āorderā, i can change the status from open to in order but in the second case āclaimā i cannot change the status from in order to open nor change the buyerid field.
in fact for āclaimā i donāt even get the log message āstatus runā. so it seeems the method isnt even called.
any idea? thank you