diff --git a/ProjectSourceCode/src/resources/css/league-page/league-page.css b/ProjectSourceCode/src/resources/css/league-page/league-page.css index 38a1182..9ab91a6 100644 --- a/ProjectSourceCode/src/resources/css/league-page/league-page.css +++ b/ProjectSourceCode/src/resources/css/league-page/league-page.css @@ -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 */ } diff --git a/ProjectSourceCode/src/resources/routes/league-pages/get-current-league-information.js b/ProjectSourceCode/src/resources/routes/league-pages/get-current-league-information.js index 3c5e1dc..5e2e20d 100644 --- a/ProjectSourceCode/src/resources/routes/league-pages/get-current-league-information.js +++ b/ProjectSourceCode/src/resources/routes/league-pages/get-current-league-information.js @@ -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 } }; diff --git a/ProjectSourceCode/src/views/pages/league-page.hbs b/ProjectSourceCode/src/views/pages/league-page.hbs index fe94979..f6f0eb1 100644 --- a/ProjectSourceCode/src/views/pages/league-page.hbs +++ b/ProjectSourceCode/src/views/pages/league-page.hbs @@ -1,36 +1,34 @@ - +
League ID: {{leagueID}}
- {{#if leagues}} -No league data available
- {{/if}} - - + +