Created new users database with userID, Created favoriteteams database, implemented add favorite team function but not working just yet

This commit is contained in:
Vishal Vunnam
2024-04-17 21:45:27 -06:00
parent 6faec75ae2
commit 86dbef4bf1
6 changed files with 42 additions and 23 deletions

View File

@@ -15,7 +15,7 @@ const fetchClubsData = async (req, res, next) => {
// Extract relevant data from the API response
const clubData = response.data;
res.locals.user = users
// Attach the data to res.locals
res.locals.club = {
area: {

View File

@@ -17,7 +17,7 @@ const fetchLeaguesData = async (req, res, next) => {
const leagueData = response.data;
// Attach the data to res.locals
res.locals.username = req.session.user.username;
//res.locals.username = req.session.user.username;
console.log(req.session.user)
res.locals.league = {
area: {

View File

@@ -8,9 +8,7 @@ module.exports = function generateLeagueRoutes(app) {
// Define a route to handle requests to "/league/:leagueName"
app.get('/league/:leagueID', (req, res) => {
// Extract the league name from the URL parameters
console.log("jskjfhskjhdfkjh")
const leagueID = req.params.leagueID;
const user = req.session.user;
// Render the league page template using Handlebars
res.render('pages/leagues-page', { leagueID: leagueID, user: user});
});