forked from lucaspatenaude/ScoreSpot
Created new users database with userID, Created favoriteteams database, implemented add favorite team function but not working just yet
This commit is contained in:
@@ -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: {
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -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});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user