$w ( '#likeBtn' ). onClick ( function () {
let id = $w ( '#dynamicDataset' ). getCurrentItem (). _id ; //get id from the current item from dataset
let options = { "suppressAuth" : **true** , "suppressHooks" : **false** }; //want to bypass permission check
wixData . **get** ( "ba7ari" , id , options ) //getting the item
. then ( ( item ) => {
item . likes ++; // incrementing the likes by one
wixData . update ( "ba7ari" , item , options ); //updating the database (ERROR comes up)
});
The Website " https://www.gawla. net/alexandria-shops/%D9%81%D8%B1%D8%A7%D8%B4%D8%A9-%D9%87%D8%B1%D9%8A%D8%B3%D8%A9?siteRevision=1751 "
PS: The dataset i am working with is only for site members and i want any visitor to be able to like then update the like field in the dataset. In the Update function, i can supress the check for the permission so the info can be updated in the dataset. For the update function to work correctly i have to get the item, change what is needed to be changed then update with the item changed Value. I cannot use setfieldvalue because the value wouldn’t be accepted due to the submitter being not a site member