32 lines
909 B
Vue
32 lines
909 B
Vue
<script setup>
|
|
import {useRouter} from "vue-router";
|
|
import {useQuasar} from "quasar";
|
|
import POIForm from "components/poi/POIForm.vue";
|
|
import {usePointsOfInterestStore} from "stores/PointsOfInterest";
|
|
import {successObject} from "src/composables/dialog";
|
|
import {useAppStore} from "stores/App";
|
|
import {storeToRefs} from "pinia";
|
|
|
|
const $q = useQuasar();
|
|
const router = useRouter();
|
|
|
|
const handleSave = (formData) => {
|
|
usePointsOfInterestStore().create(formData).then(() => {
|
|
$q.notify(successObject("Místo úspěšně uloženo"));
|
|
router.push({name: "poi"});
|
|
})
|
|
}
|
|
useAppStore().setPageTitle("Nové zajímavé místo");
|
|
useAppStore().setBreadcrumbs([
|
|
{to: "poi", label: "Zajímavá místa"},
|
|
{label: "Nové"},
|
|
])
|
|
|
|
const {isMutationRunning} = storeToRefs(usePointsOfInterestStore());
|
|
|
|
</script>
|
|
|
|
<template>
|
|
<POIForm @save="handleSave" :is-request-pending="isMutationRunning"/>
|
|
</template>
|