Hello Everyone,
I have this code to read an entry of the db with the _id and update one of its column. Its not working. Any help on this is really appreciated.
async function findAction(actionID) {
const action = await wixData.get(“Actions”, actionID);
return action;
}
// Share it button click
export function button6_click(event) {
const actionID = local.getItem(“actionId”);
findAction(actionID)
.then((item) => {
console.log(“got action:” + item);
const userInputs = item.endUserInputs;
item.endUserInputs = userInputs + “+shareIt=” + $w(‘#textBox3’).value;
console.log(item._id);
console.log("updating with new user inputs without: " + item.endUserInputs);
wixData.save(“Actions”, item);
//wixData.update(“Actions”, item)
})
.then((results) => {
console.log(“really updated”);
console.log(“updated database”);
$w(‘#text8’).show();
})
. catch ( (err) => {
let errorMsg = err;
console.log(errorMsg);
}
);
}