From b611c9014cf2e353bcd8e882fc2fc097e3c51a5a Mon Sep 17 00:00:00 2001 From: Lucas Patenaude Date: Thu, 4 Apr 2024 22:37:44 -0600 Subject: [PATCH] Add links to all leagues in array that retrieves all game data --- .../resources/js/scoreboard-header/current-match-routes.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ProjectSourceCode/src/resources/js/scoreboard-header/current-match-routes.js b/ProjectSourceCode/src/resources/js/scoreboard-header/current-match-routes.js index acafc17..e8b5269 100644 --- a/ProjectSourceCode/src/resources/js/scoreboard-header/current-match-routes.js +++ b/ProjectSourceCode/src/resources/js/scoreboard-header/current-match-routes.js @@ -13,7 +13,7 @@ const fetchMatchesData = async (req, res, next) => { const yesterday = yesterdayUnformatted.format('YYYY-MM-DD'); // Array of years to fetch matches data - const years = [2002, 2003, 2021]; + const league_id = [2021, 2002, 2014, 2019, 2015, 2013]; // Array to store all matches data let allMatches = []; @@ -21,7 +21,7 @@ const fetchMatchesData = async (req, res, next) => { // Loop through each year and fetch matches data for (const year of years) { const response = await axios({ - url: `http://api.football-data.org/v4/competitions/${year}/matches`, + url: `http://api.football-data.org/v4/competitions/${league_id}/matches`, method: 'GET', params: { dateFrom: yesterday, // Set dateFrom to yesterday's date