diff --git a/pages/support/[id].vue b/pages/support/[id].vue index f8897ad..54f98b8 100644 --- a/pages/support/[id].vue +++ b/pages/support/[id].vue @@ -36,6 +36,24 @@ const addMessage = async () => { setup() if(profileStore.currentTenant !== 5) { await useFunctions().useSendTelegramNotification(`Neue Nachricht im Ticket ${useRoute().params.id} von ${profileStore.activeProfile.fullName}: ${data.content}`) + } else if(profileStore.activeProfile.id !== itemInfo.value.created_by) { + + let notification = { + tenant: itemInfo.value.tenant, + profile: itemInfo.value.created_by.id, + initiatingProfile: profileStore.activeProfile.id, + title: `Sie haben eine neue Nachricht von ${profileStore.activeProfile.fullName} im Ticket ${itemInfo.value.title}`, + link: `/support/${itemInfo.value.id}`, + message: data.content + } + + console.log(notification) + + + const {error} = await supabase.from("notifications").insert(notification) + + + } } @@ -98,6 +116,9 @@ const closeTicket = async () => { color="primary" >{{itemInfo.status}} +