Hello! I’m struggling to understand what’s wrong with my code.
import wixData from ‘wix-data’;
$w.onReady( function () {
wixData.get(“infectionStatus”, “7543b183-2cb1-4827-a100-512785714c6b”)
.then((item) => {
item.heart = item.heart - 1;
wixData.update(“infectionStatus”, item)
})
. catch ((err) => {
console.log(err);
});
})
From what you see there, if I have the “heart” column in the database at 11 for example, after running that code, it should be updated to be 10. But apparently it’s not, and it’s 9 instead…I’ve tried going through everything I could, but it just doesn’t make any sense to why it’s displaying 9 instead of 10…
Any help would be greatly appreciated.