0
0
Fork 0

Fix routes form update

This commit is contained in:
Kevin Martinez 2024-02-22 21:49:07 -03:00
parent 4da74f8710
commit 53f69738a5
2 changed files with 4 additions and 5 deletions

View File

@ -18,8 +18,8 @@ const { t } = useI18n();
const route = useRoute(); const route = useRoute();
const router = useRouter(); const router = useRouter();
const stateStore = useStateStore(); const stateStore = useStateStore();
const shelvingId = route.params?.id || null; const shelvingId = ref(route.params?.id || null);
const isNew = Boolean(!shelvingId); const isNew = Boolean(!shelvingId.value);
const defaultInitialData = { const defaultInitialData = {
agencyModeFk: null, agencyModeFk: null,
created: null, created: null,
@ -111,7 +111,7 @@ const onSave = (data, response) => {
auto-load auto-load
/> />
<FormModel <FormModel
:url="isNew ? null : `Routes/${shelvingId}`" :url="isNew ? null : `Routes/${route.params?.id}`"
:url-create="isNew ? 'Routes' : null" :url-create="isNew ? 'Routes' : null"
:observe-form-changes="!isNew" :observe-form-changes="!isNew"
:filter="routeFilter" :filter="routeFilter"

View File

@ -14,7 +14,6 @@ import {ref} from "vue";
const { t } = useI18n(); const { t } = useI18n();
const router = useRouter(); const router = useRouter();
const route = useRoute(); const route = useRoute();
const entityId = route.params?.id || null;
const supplierList = ref([]); const supplierList = ref([]);
const filter = { include: [{ relation: 'supplier' }] }; const filter = { include: [{ relation: 'supplier' }] };
@ -33,7 +32,7 @@ const onSave = (data, response) => {
@on-fetch="(data) => (supplierList = data)" @on-fetch="(data) => (supplierList = data)"
/> />
<FormModel <FormModel
:url="`Roadmaps/${entityId}`" :url="`Roadmaps/${route.params?.id}`"
observe-form-changes observe-form-changes
:filter="filter" :filter="filter"
model="roadmap" model="roadmap"