Hi,
I was following a guide on Live Queries, so I got working that when a record gets created a function is called.
init = async () => {
console.log("I have been summoned!");
let query = new Moralis.Query("KekwTokenEvents");
let subscription = await query.subscribe();
subscription.on("create", onTokenMint);
getImage();
};
onTokenMint = (token) => {
try {
console.log(token);
console.log("Minting... Token ID:" + token.attributes.ID);
//uploadMetadata(token.attributes.ID);
} catch (err) {
console.log("Error Occured: ");
console.log(err);
}
};
When going into the onTokenMint function and passing the token. I only get the following object returned:
It has no attributes array, while in the database it does have attributes:
How do I get the object with attributes?