Updates to routes

This commit is contained in:
Lucas Patenaude
2024-04-10 23:40:54 -06:00
parent f68c5b0c24
commit 508c0ac708
2 changed files with 2 additions and 2 deletions

View File

@@ -173,7 +173,7 @@ app.post('/register', async (req, res) => {
await db.none('INSERT INTO users (username, password) VALUES ($1, $2)', [req.body.username, hash]);
// Redirect user to the login page after successful registration
res.redirect('/login');
res.redirect('/home');
} catch (error) {
// If an error occurs during registration, respond with status 500 and an error message
res.status(500).json({ status: 'error', message: 'An error occurred during registration' });

View File

@@ -7,7 +7,7 @@ const fetchMatchesData = async (req, res, next) => {
const today = moment().format('YYYY-MM-DD'); // Get today's date in YYYY-MM-DD format
// Subtract one day to get yesterday's date
const yesterdayUnformatted = moment().subtract(3, 'days');
const yesterdayUnformatted = moment().subtract(8, 'days');
// Format yesterday's date as YYYY-MM-DD
const yesterday = yesterdayUnformatted.format('YYYY-MM-DD');