diff --git a/src/message/index.ts b/src/message/index.ts index 38d788a2a..9e6babce1 100644 --- a/src/message/index.ts +++ b/src/message/index.ts @@ -17,7 +17,12 @@ export function getErrorText(r): string { return data?.message || r.message } -export function error(e, actions = []) { +export interface Action { + title: string, + callback: () => void, +} + +export function error(e, actions: Action[] = []) { notify({ type: 'error', title: i18n.global.t('error.error'), @@ -26,7 +31,7 @@ export function error(e, actions = []) { }) } -export function success(e, actions = []) { +export function success(e, actions: Action[] = []) { notify({ type: 'success', title: i18n.global.t('error.success'), diff --git a/src/views/tasks/TaskDetailView.vue b/src/views/tasks/TaskDetailView.vue index b30508280..7dbd20b2b 100644 --- a/src/views/tasks/TaskDetailView.vue +++ b/src/views/tasks/TaskDetailView.vue @@ -496,6 +496,7 @@ import {useKanbanStore} from '@/stores/kanban' import {useTitle} from '@/composables/useTitle' import {success} from '@/message' +import type {Action as MessageAction} from '@/message' const props = defineProps({ taskId: { @@ -728,7 +729,7 @@ async function saveTask(args?: { Object.assign(task, newTask) setActiveFields() - let actions = [] + let actions: MessageAction[] = [] if (undoCallback !== null) { actions = [{ title: t('task.undo'),