
Redeem code
redeem status
my FUCKING HEEL JavaScript
import wixData from 'wix-data';
$w.onReady(function () {
// Add an event handler for the submit button
$w('#button1').onClick(() => {
const inputCode = $w('#textBox1').value;
// Query the database to check if the code exists
wixData.query('redeem')
.eq('code', inputCode) // Update the field name 'code' to match your database field name
.find()
.then((results) => {
if (results.items.length === 0) {
// Code not found, show an error message
$w('#text14').text = 'Invalid code. Please try again.';
} else {
// Code found, retrieve the reward (assuming there is only one item with the code)
const reward = results.items[0].Reward;
// Display the reward on the page
$w('#text14').text = `Congratulations! Your reward is ${reward}.`;
// You can also add further actions here, like sending an email notification to the user.
}
})
.catch((error) => {
// Handle any errors that might occur during the database query
console.error('Error:', error);
});
});
});
แม่งเอยอีดอกทองสัสแม่งโค้ดที่กูเขียนกูใส่หรัสถูกตามที่อยู่ใน databasd แต่มันก่อยังจะบอกว่ารหัสไม่ถูกต้องกูนี้ขึ้นเลยกูใช้ chat gpt มาช่วยแม่งยังเหมือนเดิมอีเหี้ย javascript ส้นตีนมึงเป็นเหี้ยอะไร javascript เหี้ยชิบหาย มึงไป error ไกลๆตีนกูไป
ล่าสุดกูทะเลาะกับ javascript