Skip to content

Commit

Permalink
Sort schools in school dropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
Matushl committed Nov 24, 2024
1 parent 1742230 commit dab7366
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/SchoolSubForm/SchoolSubForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const SchoolSubForm = ({control, watch, setValue, gap}: SchoolSubFormProp
queryKey: ['personal', 'schools'],
queryFn: () => axios.get<ISchool[]>(`/api/personal/schools`),
})
const schools = schoolsData?.data ?? []
const schools = (schoolsData?.data ?? []).sort((a, b) => a.name.localeCompare(b.name))
const allSchoolItems: SelectOption[] = schools.map(({code, city, name, street}) => ({
id: code,
label: city ? `${name} ${street}, ${city}` : name,
Expand Down

0 comments on commit dab7366

Please sign in to comment.