add spaces
This commit is contained in:
@@ -20,6 +20,7 @@ const props = defineProps({
|
|||||||
|
|
||||||
const spaceName = ref('')
|
const spaceName = ref('')
|
||||||
const spaceDescription = ref('')
|
const spaceDescription = ref('')
|
||||||
|
const createCategories = ref(true)
|
||||||
|
|
||||||
const cancel = () => {
|
const cancel = () => {
|
||||||
resetForm()
|
resetForm()
|
||||||
@@ -30,6 +31,7 @@ const createSpace = async () => {
|
|||||||
const space = new Space()
|
const space = new Space()
|
||||||
space.name = spaceName.value
|
space.name = spaceName.value
|
||||||
space.description = spaceDescription.value
|
space.description = spaceDescription.value
|
||||||
|
space.createCategories = createCategories.value
|
||||||
try {
|
try {
|
||||||
await createSpaceRequest(space)
|
await createSpaceRequest(space)
|
||||||
resetForm()
|
resetForm()
|
||||||
@@ -59,6 +61,10 @@ const resetForm = () => {
|
|||||||
<label for="name">Описание</label>
|
<label for="name">Описание</label>
|
||||||
<Textarea v-model="spaceDescription" id="name" class="w-full"/>
|
<Textarea v-model="spaceDescription" id="name" class="w-full"/>
|
||||||
</FloatLabel>
|
</FloatLabel>
|
||||||
|
<div class="flex flex-row items-center min-w-fit gap-4">
|
||||||
|
<Checkbox v-model="createCategories" binary/>
|
||||||
|
Создать стандартный набор категорий?
|
||||||
|
</div>
|
||||||
<div class="flex flex-row gap-2 justify-end items-center">
|
<div class="flex flex-row gap-2 justify-end items-center">
|
||||||
<Button label="Создать" severity="success" icon="pi pi-save" @click="createSpace"/>
|
<Button label="Создать" severity="success" icon="pi pi-save" @click="createSpace"/>
|
||||||
<Button label="Отмена" severity="secondary" icon="pi pi-times-circle" @click="cancel"/>
|
<Button label="Отмена" severity="secondary" icon="pi pi-times-circle" @click="cancel"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user