Added Frontend
This commit is contained in:
62
frontend/pages/support/create.vue
Normal file
62
frontend/pages/support/create.vue
Normal file
@@ -0,0 +1,62 @@
|
||||
<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>
|
||||
Reference in New Issue
Block a user