From 0fb9b22935c1dec0e5d456e29e92d6dcd355e491 Mon Sep 17 00:00:00 2001 From: jorgep Date: Mon, 14 Oct 2024 14:09:52 +0200 Subject: [PATCH] chore: refs #7874 refactor code --- src/components/ui/VnNotes.vue | 2 +- .../Defaulter/CustomerDefaulterAddObservation.vue | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/components/ui/VnNotes.vue b/src/components/ui/VnNotes.vue index 98a511484..e23eeb121 100644 --- a/src/components/ui/VnNotes.vue +++ b/src/components/ui/VnNotes.vue @@ -29,7 +29,7 @@ const { t } = useI18n(); const state = useState(); const quasar = useQuasar(); const currentUser = ref(state.getUser()); -const newNote = reactive({ text: '', observationTypeFk: null }); +const newNote = reactive({ text: null, observationTypeFk: null }); const observationTypes = ref([]); const vnPaginateRef = ref(); diff --git a/src/pages/Customer/Defaulter/CustomerDefaulterAddObservation.vue b/src/pages/Customer/Defaulter/CustomerDefaulterAddObservation.vue index 9bdb0ad5b..27dfe48e6 100644 --- a/src/pages/Customer/Defaulter/CustomerDefaulterAddObservation.vue +++ b/src/pages/Customer/Defaulter/CustomerDefaulterAddObservation.vue @@ -25,20 +25,22 @@ const { notify } = useNotify(); const { t } = useI18n(); const newObservation = ref(null); +const obsId = ref(null); const onSubmit = async () => { try { - const observationTypeFk = ( - await axios.get('ObservationTypes/findOne', { - params: { filter: { where: { description: 'Finance' } } }, - }) - ).data?.id; + if (!obsId.value) + obsId.value = ( + await axios.get('ObservationTypes/findOne', { + params: { filter: { where: { description: 'Finance' } } }, + }) + ).data?.id; const bodyObs = $props.clients.map((item) => { return { clientFk: item.clientFk, text: newObservation.value, - observationTypeFk, + observationTypeFk: obsId.value, }; }); await axios.post('ClientObservations', bodyObs);