import wixData from 'wix-data';
import wixLocation from 'wix-location';
$w.onReady(function () {
});
export function button29_click(event) {
let contrasena = $w('#input1').value;
wixData.query('EvaluaciondeClimaLaboral')
.eq('title', contrasena)
.eq('status', true)
.find()
.then(results => {
results.items.forEach((e) =>{
if (e.title === $w('#input1').value) {
$w('#EvaluacionD').setFieldValue("status", false);
$w('#EvaluacionD').save();
wixLocation.to("http://xxxxxxxxxxxxxxxxxxxxxxxx");
}
})
setTimeout( $w('#text134').show()
,1000)
})
}
I assume that you add the “key” in the dataset with the status boolean checked(true)
the key becomes not checked (false) after used.
I don’t code this on Wix, so there is some minor mistake, google it will helps.
Important: Since you are retrieving the data with all passwords that haven’t used on the front-end/Client-side, your data is exposed to users on the browser dev console (they can find it). And, the wix location.to means that they can save the link and skip “key” to get access to that page.
Please try moving the important code to the backend. AND try to put all the content on the same page, so they cannot save the link for future use.