Sort available equipments by id in ascending order

This commit is contained in:
Keannu Bernasol 2024-01-07 12:20:22 +08:00
parent a685e3fcb5
commit 8810daa26c

View file

@ -138,7 +138,7 @@ export default function AddTransactionPage() {
<Autocomplete <Autocomplete
multiple multiple
id="equipment-autocomplete" id="equipment-autocomplete"
options={equipments.data || []} options={equipments.data?.sort((a, b) => a.id - b.id) || []}
getOptionLabel={(option) => getOptionLabel={(option) =>
`${option.equipment_name} (ID:${option.id})` `${option.equipment_name} (ID:${option.id})`
} }