reload stores after new team is created and data imported

This commit is contained in:
Gregor Vostrak
2024-06-01 00:13:24 +02:00
parent bae4265f70
commit 4a7db27a05
2 changed files with 5 additions and 0 deletions

View File

@@ -6,6 +6,7 @@ import InputLabel from '@/Components/InputLabel.vue';
import PrimaryButton from '@/Components/PrimaryButton.vue'; import PrimaryButton from '@/Components/PrimaryButton.vue';
import TextInput from '@/Components/TextInput.vue'; import TextInput from '@/Components/TextInput.vue';
import type { User } from '@/types/models'; import type { User } from '@/types/models';
import { initializeStores } from '@/utils/init';
const form = useForm({ const form = useForm({
name: '', name: '',
@@ -15,6 +16,9 @@ const createTeam = () => {
form.post(route('teams.store'), { form.post(route('teams.store'), {
errorBag: 'createTeam', errorBag: 'createTeam',
preserveScroll: true, preserveScroll: true,
onSuccess: () => {
initializeStores();
},
}); });
}; };
const page = usePage<{ const page = usePage<{

View File

@@ -69,6 +69,7 @@ async function importData() {
reject('Import type is null'); reject('Import type is null');
}); });
}); });
initializeStores();
if (reportResult.value) { if (reportResult.value) {
showResultModal.value = true; showResultModal.value = true;
} }