Updates to routes
This commit is contained in:
@@ -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]);
|
await db.none('INSERT INTO users (username, password) VALUES ($1, $2)', [req.body.username, hash]);
|
||||||
|
|
||||||
// Redirect user to the login page after successful registration
|
// Redirect user to the login page after successful registration
|
||||||
res.redirect('/login');
|
res.redirect('/home');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// If an error occurs during registration, respond with status 500 and an error message
|
// 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' });
|
res.status(500).json({ status: 'error', message: 'An error occurred during registration' });
|
||||||
|
|||||||
@@ -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
|
const today = moment().format('YYYY-MM-DD'); // Get today's date in YYYY-MM-DD format
|
||||||
|
|
||||||
// Subtract one day to get yesterday's date
|
// 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
|
// Format yesterday's date as YYYY-MM-DD
|
||||||
const yesterday = yesterdayUnformatted.format('YYYY-MM-DD');
|
const yesterday = yesterdayUnformatted.format('YYYY-MM-DD');
|
||||||
|
|||||||
Reference in New Issue
Block a user