Dynamic View Counter

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); 

}); 

});

What exactly stopped working?

My video player hide/show code, I’m trying to also get this code to work and I’ve been told by some people that this code works, I think it could be the code editor, because ever since corvid came out, I haven’t been able to display codes that I’ve had displayed before