chore: refs #7874 refactor code
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Jorge Penadés 2024-10-14 14:09:52 +02:00
parent 4ff3c18f33
commit 0fb9b22935
2 changed files with 9 additions and 7 deletions

View File

@ -29,7 +29,7 @@ const { t } = useI18n();
const state = useState(); const state = useState();
const quasar = useQuasar(); const quasar = useQuasar();
const currentUser = ref(state.getUser()); const currentUser = ref(state.getUser());
const newNote = reactive({ text: '', observationTypeFk: null }); const newNote = reactive({ text: null, observationTypeFk: null });
const observationTypes = ref([]); const observationTypes = ref([]);
const vnPaginateRef = ref(); const vnPaginateRef = ref();

View File

@ -25,20 +25,22 @@ const { notify } = useNotify();
const { t } = useI18n(); const { t } = useI18n();
const newObservation = ref(null); const newObservation = ref(null);
const obsId = ref(null);
const onSubmit = async () => { const onSubmit = async () => {
try { try {
const observationTypeFk = ( if (!obsId.value)
await axios.get('ObservationTypes/findOne', { obsId.value = (
params: { filter: { where: { description: 'Finance' } } }, await axios.get('ObservationTypes/findOne', {
}) params: { filter: { where: { description: 'Finance' } } },
).data?.id; })
).data?.id;
const bodyObs = $props.clients.map((item) => { const bodyObs = $props.clients.map((item) => {
return { return {
clientFk: item.clientFk, clientFk: item.clientFk,
text: newObservation.value, text: newObservation.value,
observationTypeFk, observationTypeFk: obsId.value,
}; };
}); });
await axios.post('ClientObservations', bodyObs); await axios.post('ClientObservations', bodyObs);