Update to league_ids array

This commit is contained in:
Lucas Patenaude
2024-04-04 22:42:12 -06:00
parent b611c9014c
commit a0b917d0d2

View File

@@ -13,13 +13,13 @@ const fetchMatchesData = async (req, res, next) => {
const yesterday = yesterdayUnformatted.format('YYYY-MM-DD');
// Array of years to fetch matches data
const league_id = [2021, 2002, 2014, 2019, 2015, 2013];
const league_ids = [2021, 2002, 2014, 2019, 2015, 2013];
// Array to store all matches data
let allMatches = [];
// Loop through each year and fetch matches data
for (const year of years) {
for (const league_id of league_ids) {
const response = await axios({
url: `http://api.football-data.org/v4/competitions/${league_id}/matches`,
method: 'GET',