sort applicants by last name in the CSV file

This commit is contained in:
Gaspard Jankowiak 2026-06-05 12:50:41 +02:00 committed by gapato
commit ad8999877c

View file

@ -211,7 +211,7 @@ function createApplicantsCsv(applicantDetailsList) {
CSV_FIELDS.join(",")
]
applicantDetailsList.forEach((applicantDetails) => {
applicantDetailsList.sort((app1, app2) => app1.last_name.localeCompare(app2.last_name)).forEach((applicantDetails) => {
const values = CSV_FIELDS.map((fieldName) => escapeCsvValue(getApplicantCsvValue(applicantDetails, fieldName)))
rows.push(values.join(","))
})