Added Push Notification for Ticket Messages

This commit is contained in:
2025-02-27 09:37:08 +01:00
parent 58a9d72946
commit ba0646e768

View File

@@ -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}}</UBadge>
</template>
<template #center>
{{itemInfo.title}}
</template>
<template #right>
<UButton
v-if="profileStore.currentTenant === 5"