diff --git a/frontend/src/lib/components/Pagebuilder/Module.svelte b/frontend/src/lib/components/Pagebuilder/Module.svelte index edaa095..93bfb46 100644 --- a/frontend/src/lib/components/Pagebuilder/Module.svelte +++ b/frontend/src/lib/components/Pagebuilder/Module.svelte @@ -13,6 +13,11 @@ let module = $modules[col.moduleImport] || {} $: module = $modules[col.moduleImport] || {} + $: console.log( + "peron", + $team, + Object.values($team).filter((p) => p.personType == "employee") + ) {#if module.type == "iconCycleCircle"} diff --git a/frontend/src/lib/components/widgets/boxlist.svelte b/frontend/src/lib/components/widgets/boxlist.svelte index 3650b94..8a02a81 100644 --- a/frontend/src/lib/components/widgets/boxlist.svelte +++ b/frontend/src/lib/components/widgets/boxlist.svelte @@ -2,11 +2,12 @@ export let persons: Page[] let boxes = persons.map((p) => p.personPreview.name) const sortByFirstName = (a, b) => { - const nameA = a.name.split(" ")[0] // Extracts the first name from "First Last" - const nameB = b.name.split(" ")[0] - return nameA.localeCompare(nameB) + const nameA = a?.name?.split(" ")[0] // Extracts the first name from "First Last" + const nameB = b?.name?.split(" ")[0] + return nameA?.localeCompare(nameB) } boxes = boxes.sort(sortByFirstName) + $: console.log(boxes, "boxes", persons)