Update to league_ids array
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user