Skip to content

Commit

Permalink
Assigned baseItems function call to a variable instead
Browse files Browse the repository at this point in the history
  • Loading branch information
axelbjo committed May 24, 2024
1 parent 645ef9f commit e4f9709
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions server/utils/breadcrumbUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// See https://confluence.sys.kth.se/confluence/x/6wYJDQ for more information.

const i18n = require('../../i18n')
const baseItems = language => {
const createBaseItems = language => {
const langIndex = language === 'en' ? 0 : 1
const { breadCrumbs } = i18n.messages[langIndex]
return {
Expand Down Expand Up @@ -31,7 +31,8 @@ function createAboutCourseItem(language, courseCode) {
}

function createBreadcrumbs(language, courseCode) {
const items = [baseItems(language).student, baseItems(language).studies, baseItems(language).directory]
const baseItems = createBaseItems(language)
const items = [baseItems.student, baseItems.studies, baseItems.directory]
if (courseCode) {
items.push(createAboutCourseItem(language, courseCode))
}
Expand Down

0 comments on commit e4f9709

Please sign in to comment.