@feelurlifenow Very interesting that the insert did not resolve. Try this code to see if you can catch the error:
let item = await wixData.insert(“Posts_attributes”, toInsert).catch((err) => {console.log(err)});
Thanks for sharing the logs. I’m wondering if it doesn’t like that you have a .then() in the query with await. Try changing updaterecord() to this and see if that helps:
async function updaterecord(id, color, count) {
console.log (id, color, count);
let results = await wixData.query(“Posts_attributes”)
.eq(“postId”, id)
.find();
let record = results.items[0];
record.color = color;
record.likes = count;
console.log(record.postId, record.title);
// Not sure if you need to wait on this one or not…
wixData.update(“Posts_attributes”, record);
return;
}