From e4f970906a2fa5ef9897be5fd7b6036cd532b50a Mon Sep 17 00:00:00 2001 From: axelbjo Date: Fri, 24 May 2024 11:28:51 +0200 Subject: [PATCH] Assigned baseItems function call to a variable instead --- server/utils/breadcrumbUtil.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/utils/breadcrumbUtil.js b/server/utils/breadcrumbUtil.js index 9d9ae2ee..6ba70a64 100644 --- a/server/utils/breadcrumbUtil.js +++ b/server/utils/breadcrumbUtil.js @@ -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 { @@ -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)) }