Added Push Notification for Ticket Messages
This commit is contained in:
@@ -36,6 +36,24 @@ const addMessage = async () => {
|
|||||||
setup()
|
setup()
|
||||||
if(profileStore.currentTenant !== 5) {
|
if(profileStore.currentTenant !== 5) {
|
||||||
await useFunctions().useSendTelegramNotification(`Neue Nachricht im Ticket ${useRoute().params.id} von ${profileStore.activeProfile.fullName}: ${data.content}`)
|
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"
|
color="primary"
|
||||||
>{{itemInfo.status}}</UBadge>
|
>{{itemInfo.status}}</UBadge>
|
||||||
</template>
|
</template>
|
||||||
|
<template #center>
|
||||||
|
{{itemInfo.title}}
|
||||||
|
</template>
|
||||||
<template #right>
|
<template #right>
|
||||||
<UButton
|
<UButton
|
||||||
v-if="profileStore.currentTenant === 5"
|
v-if="profileStore.currentTenant === 5"
|
||||||
|
|||||||
Reference in New Issue
Block a user