i am a beginner in in programing so bear with me please
this is a repeater , with 4 inputs should carry and view data from collection called visits
i did view visits data in a input so that i can change the values of a certain field, and there is a button to trigger the changes.
but i am so stupid and have no knowledge but i am trying my best to learn.
this is my code i know its a very ugly and stupid code , but really can use some help because it does not work
export function repeater1_itemReady($W, itemData, index) {
$w('#button3').onClick(() => {
console.log('1 pass')
const item = itemData
const h = item._id
console.log(h)
itemData.detail = $w('#textBox1').value
itemData.quadrant = $w('#input4').value
itemData.premeasure = $w('#input3').value
itemData.toothnumber = $w('#input2').value
let toUpdate = {
"_id": h,
"date": "Mr.",
"detail": $w('#textBox1').value,
"quadrant": $w('#input4').value,
"premeasure": $w('#input3').value,
"toothnumber": $w('#input2').value
};
wixData.update("visits", toUpdate)
.then((results) => {
let item = results; //see item below
})
.catch((err) => {
let errorMsg = err;
});
})