Hi, I have been trying to collect number of clicks on a certain button.
In order to do that I did the following steps:
- Create a new DataBase called PrivacySiteDB
- I created a button called button1
- Under OnClick event I coded the following:
//Add your code for this event here:
wixData.query("PrivacySiteDB").find().then( (results) => {
let item = results.items[0];
item.PrivacyCount++;
wixData.update("PrivacySiteDB", item).then();
}).catch( (err) =>
{
wixLocation.to("https://blockstack.org/");
});
The reason I used the catch/err is to debug and not if it failed somewhere in the code.
It seems that it even doesn’t find the DB and the query returns NULL.
am I missing something?
Thanks,
Adam