Skip to content

Commit

Permalink
Check for user in faculties route
Browse files Browse the repository at this point in the history
  • Loading branch information
Keskimaki committed Feb 24, 2023
1 parent e6b41c2 commit d640d66
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/server/routes/faculty.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ facultyRouter.get('/', async (req, res) => {
facultyRouter.get('/user', async (req: RequestWithUser, res) => {
const { id, iamGroups } = req.user

if (!id) return res.send([])

const organisationData = await getUserOrganisations(id, iamGroups)

const faculties = organisationData.map(({ code, name }) => ({ code, name }))
Expand Down

0 comments on commit d640d66

Please sign in to comment.