adding stuff to the onClick

This commit is contained in:
noahnghg
2025-04-20 21:18:43 -06:00
parent f7e4b49ac8
commit 25f2c3d8af
5 changed files with 39 additions and 4 deletions

View File

@@ -7,10 +7,11 @@ exports.createTransaction = async (req, res) => {
const { userID, productID, date, paymentStatus } = req.body;
try {
const formattedDate = new Date(date).toISOString().slice(0, 19).replace("T", " ");
const [result] = await db.execute(
`INSERT INTO Transaction (UserID, ProductID, Date, PaymentStatus)
VALUES (?, ?, ?, ?)`,
[userID, productID, date, paymentStatus]
[userID, productID, formattedDate, paymentStatus]
);
res.json({

View File

@@ -4,6 +4,7 @@ const pool = mysql.createPool({
host: "localhost",
user: "root",
database: "Marketplace",
password: "12345678"
});
module.exports = pool.promise();

View File

@@ -18,7 +18,7 @@ async function sendVerificationEmail(email, verificationCode) {
// Clean up expired verification codes (run this periodically)
function cleanupExpiredCodes() {
db_con.query(
db.query(
"DELETE FROM AuthVerification WHERE Date < DATE_SUB(NOW(), INTERVAL 15 MINUTE) AND Authenticated = 0",
(err, result) => {
if (err) {