SOLVED! How to update item field from dynamic dataset? Happy to pay for a working answer

Hey I’m trying to update/add two new values to an item in a dynamic dataset when this one is submitted by a user.
Below is the code, d oes anyone know why it is not working? It seems to be working in the editor but for some reason it does not work in the live site

$w.onReady(function () {
    $w("#dataset1").onAfterSave(() => {
        wixData.aggregate("Alquileres")
            .run()
            .then((results) => {
                if (results.items.length > 0) {
                    let items = results.items; 
                    let ur = "https://veganflat.com/alquileres/"
                    let icon = 
"https://static.wixstatic.com/media/5b7658_2cb213baa50f4d0382725c74aae58840~mv2.png"
                    let iterator = items.values()
                    for (let item of iterator) {
                        console.log(item)
                        let ref = item['title']
                        let id = item._id
                        let nref = ref.replace(/ /g, "-")
                        let nurl = ur.concat(nref)
                        console.log(nurl)
                        wixData.get("Alquileres", id)
                            item.icon = icon;
                            item.maplocations = nurl;
                            wixData.update("Alquileres", item);

                    }
                }
            })
    });
    

SOLVED by doing trying a different approach,
instead of updating all items every time a new one is uploaded I make the changes on the current item after this one is uploaded

$w.onReady(function () {
    $w("#dataset1").onAfterSave(() => {
 let item = $w("#dataset1").getCurrentItem()
 let preu = item.precio.toLocaleString('en')
 let eur = preu.concat("€ ")
 let tmap = eur.concat(item.titulo)
 let id = item._id
 let ur = "https://veganflat.com/alquileres/"
 let icn = "https://static.wixstatic.com/media/5b7658_2cb213baa50f4d0382725c74aae58840~mv2.png"
 let nurl = ur.concat(id)
        wixData.get("Alquileres", id)
        item.icon = icn;
        item.titulomapa = tmap; 
        item.maplocations = nurl; // updated last name
        wixData.update("Alquileres", item);
    })
})