0
0
Fork 0

chore: refs #7874 refactor code

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 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();

View File

@ -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);