Fix for sorting, didn't account for some primitive types.

This commit is contained in:
mike12345567 2024-09-03 18:50:01 +01:00
parent 2a24a3dda6
commit 2d6a8d9ff5
1 changed files with 7 additions and 3 deletions

View File

@ -143,12 +143,16 @@ export function basicProcessing({
return relatedRow
})
.sort((a, b) => {
if (!a?.[sortField]) {
const aField = a?.[sortField],
bField = b?.[sortField]
if (!aField) {
return 1
} else if (!b?.[sortField]) {
} else if (!bField) {
return -1
}
return a[sortField].localeCompare(b[sortField])
return aField.localeCompare
? aField.localeCompare(bField)
: aField - bField
})
}
}