League data imported to league page

This commit is contained in:
Lucas Patenaude
2024-04-13 15:19:16 -06:00
parent f142b8e285
commit 5644bd1b28
2 changed files with 31 additions and 31 deletions

View File

@@ -94,10 +94,14 @@ const fetchLeaguesData = require('./resources/routes/league-pages/get-current-le
// Define the route for fetching league data
app.get('/league/:leagueID', fetchLeaguesData, (req, res) => {
// Handle the response here
res.json(res.locals.leagues);
// Render the Handlebars view with league data
res.render('pages/league-page', {
leagueID: req.params.leagueID,
leagues: res.locals.leagues
});
});
// *****************************************************
// <!-- Section 5 : API Routes -->
// *****************************************************