add spaces

This commit is contained in:
xds
2025-02-17 18:31:56 +03:00
parent fe56505629
commit 83ac14dcd1

View File

@@ -20,6 +20,7 @@ const props = defineProps({
const spaceName = ref('')
const spaceDescription = ref('')
const createCategories = ref(true)
const cancel = () => {
resetForm()
@@ -30,6 +31,7 @@ const createSpace = async () => {
const space = new Space()
space.name = spaceName.value
space.description = spaceDescription.value
space.createCategories = createCategories.value
try {
await createSpaceRequest(space)
resetForm()
@@ -59,6 +61,10 @@ const resetForm = () => {
<label for="name">Описание</label>
<Textarea v-model="spaceDescription" id="name" class="w-full"/>
</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">
<Button label="Создать" severity="success" icon="pi pi-save" @click="createSpace"/>
<Button label="Отмена" severity="secondary" icon="pi pi-times-circle" @click="cancel"/>