forked from lucaspatenaude/ScoreSpot
League page stylization added
This commit is contained in:
@@ -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 */
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user