31 lines
955 B
Vue
31 lines
955 B
Vue
<script setup>
|
|
import {useRouter} from "vue-router";
|
|
import {useQuasar} from "quasar";
|
|
import {successObject} from "src/composables/dialog";
|
|
import {useOrganizationsStore} from "stores/Organizations";
|
|
import {useAppStore} from "stores/App";
|
|
import OrganizationForm from "components/organizations/OrganizationForm.vue";
|
|
import {storeToRefs} from "pinia";
|
|
|
|
const $q = useQuasar();
|
|
const router = useRouter();
|
|
const handleSave = (formData) => {
|
|
useOrganizationsStore().create(formData).then(() => {
|
|
$q.notify(successObject("Organizace úspěšně vytvořena"));
|
|
router.push({name: "organizations"});
|
|
});
|
|
};
|
|
|
|
useAppStore().setPageTitle("Nová organizace");
|
|
useAppStore().setBreadcrumbs([
|
|
{to: {name: "organizations"}, label: "Organizace"},
|
|
{label: "Nová"}
|
|
]);
|
|
|
|
const {isMutationRunning} = storeToRefs(useOrganizationsStore());
|
|
</script>
|
|
|
|
<template>
|
|
<OrganizationForm @save="handleSave" :is-request-pending="isMutationRunning"/>
|
|
</template>
|