Sort entry observation options
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details

This commit is contained in:
William Buezas 2024-02-05 12:04:28 -03:00
parent cde41ab337
commit 28790705ea
1 changed files with 7 additions and 1 deletions

View File

@ -15,6 +15,12 @@ const { t } = useI18n();
const entryObservationsRef = ref(null);
const entryObservationsOptions = ref([]);
const sortEntryObservationOptions = (data) => {
entryObservationsOptions.value = [...data].sort((a, b) =>
a.description.localeCompare(b.description)
);
};
onMounted(() => {
if (entryObservationsRef.value) entryObservationsRef.value.reload();
});
@ -22,7 +28,7 @@ onMounted(() => {
<template>
<FetchData
url="ObservationTypes"
@on-fetch="(data) => (entryObservationsOptions = data)"
@on-fetch="(data) => sortEntryObservationOptions(data)"
auto-load
/>
<CrudModel