League data imported to league page
This commit is contained in:
@@ -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 -->
|
||||
// *****************************************************
|
||||
|
||||
Reference in New Issue
Block a user