diff --git a/frontend/src/pages/Deal.vue b/frontend/src/pages/Deal.vue index 53d44cf8..65d6ddd5 100644 --- a/frontend/src/pages/Deal.vue +++ b/frontend/src/pages/Deal.vue @@ -72,19 +72,35 @@ - + @@ -294,6 +310,7 @@ import { createToast, setupAssignees, setupCustomActions, + errorMessage, } from '@/utils' import { globalStore } from '@/stores/global' import { contactsStore } from '@/stores/contacts' diff --git a/frontend/src/pages/Lead.vue b/frontend/src/pages/Lead.vue index e68fcc28..33f34b3a 100644 --- a/frontend/src/pages/Lead.vue +++ b/frontend/src/pages/Lead.vue @@ -113,19 +113,35 @@ - + @@ -257,6 +273,7 @@ import { createToast, setupAssignees, setupCustomActions, + errorMessage, } from '@/utils' import { globalStore } from '@/stores/global' import { contactsStore } from '@/stores/contacts' diff --git a/frontend/src/utils/index.js b/frontend/src/utils/index.js index 3477004b..fd17796f 100644 --- a/frontend/src/utils/index.js +++ b/frontend/src/utils/index.js @@ -129,4 +129,13 @@ export function setupCustomActions(data, obj) { let script = new Function(data._form_script + '\nreturn setupForm')() let formScript = script(obj) data._customActions = formScript?.actions || [] -} \ No newline at end of file +} + +export function errorMessage(title, message) { + createToast({ + title: title || 'Error', + text: message, + icon: 'x', + iconClasses: 'text-red-600', + }) +}