0
0
Fork 0

fix: accountBasicData after update

This commit is contained in:
Javier Segarra 2024-06-05 11:35:48 +02:00
parent 3227d299e9
commit c87629f2ec
1 changed files with 9 additions and 0 deletions

View File

@ -5,23 +5,32 @@ import VnSelect from 'src/components/common/VnSelect.vue';
import FormModel from 'components/FormModel.vue'; import FormModel from 'components/FormModel.vue';
import VnRow from 'components/ui/VnRow.vue'; import VnRow from 'components/ui/VnRow.vue';
import VnInput from 'src/components/common/VnInput.vue'; import VnInput from 'src/components/common/VnInput.vue';
import { ref, watch } from 'vue';
const route = useRoute(); const route = useRoute();
const { t } = useI18n(); const { t } = useI18n();
const formModelRef = ref(null);
const accountFilter = { const accountFilter = {
where: { id: route.params.id }, where: { id: route.params.id },
fields: ['id', 'email', 'nickname', 'name', 'accountStateFk', 'packages', 'pickup'], fields: ['id', 'email', 'nickname', 'name', 'accountStateFk', 'packages', 'pickup'],
include: [], include: [],
}; };
watch(
() => route.params.id,
() => formModelRef.value.reset()
);
</script> </script>
<template> <template>
<FormModel <FormModel
ref="formModelRef"
:url="`VnUsers/preview`" :url="`VnUsers/preview`"
:url-update="`VnUsers/${route.params.id}/update-user`" :url-update="`VnUsers/${route.params.id}/update-user`"
:filter="accountFilter" :filter="accountFilter"
model="Accounts" model="Accounts"
auto-load auto-load
@on-data-saved="formModelRef.fetch()"
> >
<template #form="{ data }"> <template #form="{ data }">
<VnRow class="row q-gutter-md q-mb-md"> <VnRow class="row q-gutter-md q-mb-md">