fix : use correct useToast() API in export handler
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -325,10 +325,10 @@ async function onExport(params: {
|
|||||||
client?: number
|
client?: number
|
||||||
tags?: number[]
|
tags?: number[]
|
||||||
}) {
|
}) {
|
||||||
const { success, error } = useToast()
|
const toast = useToast()
|
||||||
const { t } = useNuxtApp().$i18n as { t: (key: string) => string }
|
const { t } = useNuxtApp().$i18n as { t: (key: string) => string }
|
||||||
|
|
||||||
success(t('timeEntries.exportLoading'))
|
toast.info({ message: t('timeEntries.exportLoading') })
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const result = await timeEntryService.downloadExport(params)
|
const result = await timeEntryService.downloadExport(params)
|
||||||
@@ -342,9 +342,9 @@ async function onExport(params: {
|
|||||||
document.body.removeChild(a)
|
document.body.removeChild(a)
|
||||||
URL.revokeObjectURL(url)
|
URL.revokeObjectURL(url)
|
||||||
|
|
||||||
success(t('timeEntries.exportSuccess'))
|
toast.success({ message: t('timeEntries.exportSuccess') })
|
||||||
} catch {
|
} catch {
|
||||||
error(t('timeEntries.exportError'))
|
toast.error({ message: t('timeEntries.exportError') })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user