mirror of
https://github.com/SecurityBrewery/catalyst.git
synced 2025-12-07 15:52:47 +01:00
chore: extract handleError function (#1078)
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { Input } from '@/components/ui/input'
|
||||
import { toast } from '@/components/ui/toast'
|
||||
|
||||
import { Check, Repeat } from 'lucide-vue-next'
|
||||
|
||||
@@ -11,6 +10,7 @@ import { useRouter } from 'vue-router'
|
||||
|
||||
import { pb } from '@/lib/pocketbase'
|
||||
import type { Ticket } from '@/lib/types'
|
||||
import { handleError } from '@/lib/utils'
|
||||
|
||||
const queryClient = useQueryClient()
|
||||
const router = useRouter()
|
||||
@@ -31,13 +31,7 @@ const closeTicketMutation = useMutation({
|
||||
queryClient.invalidateQueries({ queryKey: ['tickets'] })
|
||||
router.push({ name: 'tickets', params: { type: props.ticket.expand.type.id } })
|
||||
},
|
||||
onError: (error) => {
|
||||
toast({
|
||||
title: error.name,
|
||||
description: error.message,
|
||||
variant: 'destructive'
|
||||
})
|
||||
}
|
||||
onError: handleError
|
||||
})
|
||||
|
||||
const closeButtonDisabled = false // computed(() => !props.ticket.open || message.value == '')
|
||||
|
||||
Reference in New Issue
Block a user