fix(portal) : handle ticket creation error and hide new ticket button for admins

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-15 20:04:20 +01:00
parent 2c28a4ad1d
commit f8748c4061
2 changed files with 4 additions and 0 deletions

View File

@@ -12,6 +12,7 @@
<h1 class="mt-1 text-xl font-bold text-primary-500 sm:text-2xl">{{ projectName }}</h1>
</div>
<NuxtLink
v-if="isClient"
:to="`/portal/projects/${projectId}/new-ticket`"
class="shrink-0 rounded-md bg-primary-500 px-3 py-2 text-xs font-semibold text-white hover:bg-secondary-500 sm:px-4 sm:text-sm"
>
@@ -99,6 +100,7 @@ const projectName = computed(() => {
return ''
})
const isClient = computed(() => auth.user?.roles?.includes('ROLE_CLIENT') ?? false)
const { typeBadgeClass, statusBadgeClass, formatDate } = useClientTicketHelpers()
function openDetail(ticket: ClientTicket) {

View File

@@ -125,6 +125,8 @@ async function handleSubmit() {
project: `/api/projects/${projectId.value}`,
})
await navigateTo(`/portal/projects/${projectId.value}`)
} catch {
// Toast already shown by useApi
} finally {
isSubmitting.value = false
}