Bugfixing
This commit is contained in:
@@ -5,16 +5,15 @@ import {useRouter} from "vue-router";
|
||||
import {useQuasar} from "quasar";
|
||||
import {useAppStore} from "stores/App";
|
||||
import {successObject} from "src/composables/dialog";
|
||||
import {fetchOrganizations} from "src/composables/objects/organization";
|
||||
import {onMounted} from "vue";
|
||||
import {storeToRefs} from "pinia";
|
||||
import {useUserStore} from "stores/User";
|
||||
import {useOrganizationsStore} from "stores/Organizations";
|
||||
|
||||
const $q = useQuasar();
|
||||
const router = useRouter();
|
||||
const loggedUser = storeToRefs(useUserStore()).user;
|
||||
|
||||
const handleSave = (formData) => {
|
||||
delete formData.id;
|
||||
useAircraftsStore().create(formData).then(() => {
|
||||
$q.notify(successObject("Letadlo úspěšně vytvořeno"));
|
||||
router.push({name: "aircrafts"});
|
||||
@@ -22,7 +21,7 @@ const handleSave = (formData) => {
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
fetchOrganizations();
|
||||
useOrganizationsStore().fetch();
|
||||
useAppStore().setPageTitle("Nové letadlo");
|
||||
useAppStore().setBreadcrumbs([
|
||||
{to: {name: "aircrafts"}, label: "Letadla"},
|
||||
@@ -31,7 +30,7 @@ onMounted(() => {
|
||||
});
|
||||
|
||||
const {isMutationRunning} = storeToRefs(useAircraftsStore());
|
||||
|
||||
const {organizations} = storeToRefs(useOrganizationsStore());
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -39,7 +38,7 @@ const {isMutationRunning} = storeToRefs(useAircraftsStore());
|
||||
<q-card-section>
|
||||
<AircraftForm
|
||||
:is-request-pending="isMutationRunning"
|
||||
:organizations="loggedUser.organizations"
|
||||
:organizations="organizations"
|
||||
@save="handleSave"
|
||||
/>
|
||||
</q-card-section>
|
||||
|
||||
Reference in New Issue
Block a user