League page stylization added

This commit is contained in:
Lucas Patenaude
2024-04-13 15:58:02 -06:00
parent 5644bd1b28
commit c35f242d27
3 changed files with 37 additions and 38 deletions

View File

@@ -7,6 +7,7 @@
#league-information-container {
height: 100px;
background-color: #f0f0f0; /* Example background color */
display: flex;
/* Add any other styling you need for the league information container */
}

View File

@@ -17,7 +17,7 @@ const fetchLeaguesData = async (req, res, next) => {
const leagueData = response.data;
// Attach the data to res.locals
res.locals.leagues = [{
res.locals.league = {
competition: {
league_id: leagueData.competition.id,
league_name: leagueData.competition.name,
@@ -31,11 +31,11 @@ const fetchLeaguesData = async (req, res, next) => {
team_crest: team.team.crest
},
})),
}];
};
next();
} catch (error) {
console.error('Error fetching leagues data:', error);
res.locals.leagues = []; // Set an empty array if there's an error
res.locals.league = null; // Set to null if there's an error
next(); // Call next middleware or route handler
}
};