Skip to content
This repository has been archived by the owner on Jan 17, 2025. It is now read-only.

Commit

Permalink
Merge pull request #65 from vtfk/VismaInSchool
Browse files Browse the repository at this point in the history
Visma InSchool
  • Loading branch information
runely authored Aug 14, 2021
2 parents 62971ed + 07287ae commit fb03d30
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions lib/repack-group.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const shortenSchoolName = require('./shorten-school-name')
const repackLanguage = require('./repack-languagecodes')

module.exports = (group) => {
const { grep, id, type, groupId, name, description, schoolId, schoolName, students, teachers } = group
const { grep, id, type, groupId, name, schoolId, schoolName, students, teachers } = group

// Since the two functions are calling each other, this function has to be declared inside the function for some 🤬 reason.... WTF?! 😡
const repackStudent = require('./repack-student')
Expand Down Expand Up @@ -43,19 +43,15 @@ module.exports = (group) => {
}
}

// 7_HSF1008_TESVS@38099 => HSF1008
const kode = id.split('_')[1]

// Extract name and return Extens-group
const descriptionMatch = `${description}`.match(`Undervisningsgruppa ${name} i (.*) ved .*`)
const descriptionName = descriptionMatch ? descriptionMatch[1] : description
// VO 1HSB/HSF1008 => HSF1008
const kode = name.split('/')[1]

return {
...groupInfo,
grep: {
kode,
tittel: repackLanguage({ default: descriptionName }),
kortform: repackLanguage({ default: descriptionName })
tittel: repackLanguage({ default: null }),
kortform: repackLanguage({ default: null })
}
}
}

0 comments on commit fb03d30

Please # to comment.