62 lines
1.0 KiB
Vue
62 lines
1.0 KiB
Vue
<script setup>
|
|
|
|
const router = useRouter()
|
|
|
|
const itemInfo = ref({})
|
|
const auth = useAuthStore()
|
|
|
|
|
|
const createTicket = async () => {
|
|
|
|
const ticketRes = await useEntities("tickets").create({
|
|
title: itemInfo.value.title,
|
|
})
|
|
|
|
console.log(ticketRes)
|
|
|
|
const ticketMsgRes = await useEntities("ticketmessages").create({
|
|
ticket: ticketRes.id,
|
|
created_by: auth.user.user_id,
|
|
content: itemInfo.value.content,
|
|
internal: false
|
|
})
|
|
|
|
await router.push(`/support/${ticketRes.id}`)
|
|
|
|
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
<template>
|
|
<UDashboardNavbar title="Neues Ticket erstellen">
|
|
<template #right>
|
|
<UButton
|
|
@click="createTicket"
|
|
>
|
|
Erstellen
|
|
</UButton>
|
|
</template>
|
|
</UDashboardNavbar>
|
|
<UForm class="w-2/3 mx-auto mt-5">
|
|
<UFormGroup
|
|
label="Titel:"
|
|
>
|
|
<UInput
|
|
v-model="itemInfo.title"
|
|
/>
|
|
</UFormGroup>
|
|
<UFormGroup
|
|
label="Nachricht:"
|
|
>
|
|
<UTextarea
|
|
v-model="itemInfo.content"
|
|
/>
|
|
</UFormGroup>
|
|
</UForm>
|
|
</template>
|
|
|
|
<style scoped>
|
|
|
|
</style> |