Hello! I have been trying to make a client portal where a user can input a ID code and have it verified against a database. My code looks like this.
import wixData from 'wix-data';
export function Submit_click(event) {
console.log('Click!');
const userInputText = $w('#orderIDInput').value;
wixData.query('Orders').find().then(result => {
const orderInfo = result.items[0];
if (orderInfo.orderKey === userInputText) {
$w('#orderIDInput').hide(); //hide input
$w('#Submit').hide();
$w('#verified').show(); //show text verified
console.log('All set!');
} else {
console.log('error');
}
});
}
However, when run, no result is returned. I have been looking at this for hours and can’t figure out why! Any help would be appreciated.
Best,
jerry909