Hey, I tried to delete an object using this way
const removeData = async(obj) => {
const query = new Moralis.Query('contactFormModal')
query.equalTo('objectId', obj.id )
const object = await query.first()
if(object) {
object.destroy({useMasterKey: true}).then(() => {
alert("Deleted Successfully!");
}, (error) => {
console.log(error);
})
}
}
So If I have 3 records in my table then I am only able to delete the first one not the others so anyone can tell me how I can delete a particular object onClick of the delete button?
Thank you