I need help with this Code, I understand it and I’m pretty sure it works, but I need a Mod to help make this work for my videos, I’ll paste the code in, I’ve had other code on the site that had stopped working and it happened with this code as well, can you help?
import wixLocation from ‘wix-location’;
export function btnSubmit_click(event) {
$w(“#dbCodeBank”).setFieldValue(“views”, 0);
$w("#dbCodeBank").save()
.then( (item) => {
wixLocation.to(`/home`);
} );
}
function laggedEvents() {
const currentItem = $w("#dbCodeBank").getCurrentItem();
let viewCount = currentItem.views + 1; // iterate the view counter by one
$w("#dbCodeBank").setFieldValue("views",viewCount); // set 'views' to the new value
$w('#dbCodeBank').save(); // make sure dataset is set to read and write
}
$w.onReady(function () {
$w("#dbCodeBank").onReady( () => {
setTimeout(laggedEvents,1000);
});
});