Like button in the repeater

Hi everyone,
I’m trying to implement a counter in a repeater activated by a button in the repeater. I can add 1 to all the elements or just one at first element … I have been looking for information, I have read the API, but I cannot understand where the error is also because the compiler does not mark me anything.

Can you please help me and give me advice?
THANK YOU

export function iconButton1_click(event) { // my heart icon button
$w(‘#dtsg’).onReady(() => { //dataset link to the repeater
$w(“#repeater1”).forEachItem(($item, index, itemData) => { //name repeater
let vote = $w(‘#dtsg’).getCurrentItem().poll + 1; // the field in dataset with vote number
$w(‘#dtsg’).setFieldValue(“poll”, vote); // the field where saved new vote
$w(“#dtsg”).save();
});
});
}

You should use repeater.onItemReady
https://www.wix.com/corvid/reference/$w.Repeater.html#onItemReady

and do not use .getCurrentItem(), but instead inside the onItemReady()
put

let current vote = itemData.poll;
$item("#pollText").text = vote.toLocaleString();
$item("#likeButton").onClick(event => {
vote++;
//then save it the database (it's better doing it in the backend, so you won't miss likes from different users, but if you don't care about it you can do it with the dataset.
})