Skip to content

Commit

Permalink
Merge pull request #349 from matematikk-mooc/KURSP-930-Therese-Persen…
Browse files Browse the repository at this point in the history
…-ParseString-toNumber

parsing ids of modules and coursepages to Numbers to remove console e…
  • Loading branch information
ThereseRingPersen authored Nov 9, 2023
2 parents 103184a + 05e8cad commit b69265d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/js/modules/module-selector/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function itemIsPage(item) {
export function mapModules(modules) {
try {
return modules.map((module) => ({
id: module.id,
id: Number(module.id),
label: module.name,
isCompleted: module.completed_at !== null,
type: "module",
Expand All @@ -50,7 +50,7 @@ export function mapModules(modules) {

function mapToPage(item) {
return {
id: item.id,
id: Number(item.id),
label: item.title,
type: "page",
nodes: [],
Expand All @@ -60,7 +60,7 @@ function mapToPage(item) {

function mapToSubHeader(item) {
return {
id: item.id,
id: Number(item.id),
type: "module", // You are using a fixed type 'module' here
label: item.title,
nodes: [],
Expand Down

0 comments on commit b69265d

Please sign in to comment.