-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: synchronize with Intra API every 10 minutes
- Loading branch information
Showing
4 changed files
with
26 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,18 @@ | ||
import { Express } from 'express'; | ||
import passport from 'passport'; | ||
import { PrismaClient } from '@prisma/client'; | ||
|
||
export const setupHomeRoutes = function(app: Express): void { | ||
export const setupHomeRoutes = function(app: Express, prisma: PrismaClient): void { | ||
app.get('/', passport.authenticate('session', { | ||
keepSessionInfo: true, | ||
}), (req, res) => { | ||
return res.render('index.njk'); | ||
}), async (req, res) => { | ||
// Fetch last synchronization times from the database | ||
const syncTimes = await prisma.synchronization.findMany({ | ||
orderBy: [ | ||
{ kind: 'asc' }, | ||
], | ||
}); | ||
|
||
return res.render('index.njk', { syncTimes }); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters