diff options
author | Noah Loomans <noahloomans@gmail.com> | 2018-06-26 21:46:41 +0200 |
---|---|---|
committer | Noah Loomans <noahloomans@gmail.com> | 2018-06-26 21:46:41 +0200 |
commit | 315adeb5e2012b7f7bcfcd1478f9d6dd2cc1092d (patch) | |
tree | 17ecdc44866845b679ca69337041856df3cab33c /src/server | |
parent | d95009ed42a3a94c947bccbed8a436cbf6b9306c (diff) |
Update code to comply with new styling
Diffstat (limited to 'src/server')
-rw-r--r-- | src/server/lib/schools/hetmml/getScheduleData.js | 15 | ||||
-rw-r--r-- | src/server/routes/getSchedule.js | 5 |
2 files changed, 13 insertions, 7 deletions
diff --git a/src/server/lib/schools/hetmml/getScheduleData.js b/src/server/lib/schools/hetmml/getScheduleData.js index 1d835fb..ead856f 100644 --- a/src/server/lib/schools/hetmml/getScheduleData.js +++ b/src/server/lib/schools/hetmml/getScheduleData.js @@ -128,10 +128,14 @@ function combineUsers(usersArrays) { * @returns {*} [{ type: string, value: string, alt: string, index: number }, ...] */ function getAlts(users) { - const requests = users.map(user => - axios.get(getUrlOfUser('dag', user.type, user.index, 7)), { timeout: 8000 }); - - return Promise.all(requests).then(teacherResponses => + const requests = users.map(user => ( + axios.get( + getUrlOfUser('dag', user.type, user.index, 7), + { timeout: 8000 }, + ) + )); + + return Promise.all(requests).then(teacherResponses => ( teacherResponses.map((teacherResponse, index) => { const teacherName = scrapeAltText(teacherResponse.data); @@ -139,7 +143,8 @@ function getAlts(users) { ...users[index], alt: teacherName, }; - })); + }) + )); } /** diff --git a/src/server/routes/getSchedule.js b/src/server/routes/getSchedule.js index 7a84dd2..2ade31a 100644 --- a/src/server/routes/getSchedule.js +++ b/src/server/routes/getSchedule.js @@ -48,8 +48,9 @@ function currentWeekNumber() { async function getSchedule(userType, userValue, week, scheduleType = 'dag') { const { users } = await getScheduleData(); - const user = - users.filter(user_ => user_.type === userType && user_.value === userValue)[0]; + const user = users.filter(user_ => ( + user_.type === userType && user_.value === userValue + ))[0]; if (!user) { throw new Error(`${userType}/${userValue} is not in the user index.`); |