Fix: Wagon section reload #727

Merged
jon merged 3 commits from FixWagonRedirect into dev 2024-09-19 10:45:32 +00:00
2 changed files with 4 additions and 6 deletions

View File

@ -103,7 +103,7 @@ async function remove(row) {
url-create="WagonTypes"
model="WagonType"
:form-initial-data="initialData"
@on-data-saved="window.location.reload()"
@on-data-saved="tableRef.reload()"
auto-load
>
<template #form-inputs="{ data }">

View File

@ -5,7 +5,7 @@ import { useArrayData } from 'src/composables/useArrayData';
import { useI18n } from 'vue-i18n';
import { useRouter } from 'vue-router';
import VnTable from 'src/components/VnTable/VnTable.vue';
import { computed } from 'vue';
import { computed, ref } from 'vue';
import VnSelect from 'src/components/common/VnSelect.vue';
import VnInput from 'src/components/common/VnInput.vue';
@ -14,7 +14,7 @@ const arrayData = useArrayData('WagonList');
const store = arrayData.store;
const router = useRouter();
const { t } = useI18n();
const tableRef = ref();
const filter = {
include: {
relation: 'type',
@ -107,9 +107,7 @@ async function remove(row) {
:create="{
urlCreate: 'Wagons',
title: t('Create new wagon'),
onDataSaved: () => {
window.location.reload();
},
onDataSaved: () => tableRef.reload(),
formInitialData: {},

Se puede simplificar onDataSaved: () => tableRef.reload(),

Se puede simplificar `onDataSaved: () => tableRef.reload(),`
}"
>