fix
All checks were successful
deploy to production / deploy (push) Successful in 30s

This commit is contained in:
2023-11-18 17:03:19 +00:00
parent baf4a4b7b2
commit c1b4882e5b
3 changed files with 10 additions and 6 deletions

View File

@@ -2,8 +2,9 @@
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]
const nameA = a?.split(" ")[0] // Extracts the first name from "First Last"
const nameB = b?.split(" ")[0]
console.log("nameA", nameA, "nameB", nameB, "comp", nameA?.localeCompare(nameB))
return nameA?.localeCompare(nameB)
}
boxes = boxes.sort(sortByFirstName)