upd: penerapan firebase

Deskripsi:
- pengumuman
- diskusi umum
- diskusi divisi
- divisi
- kegiatan
- tugas divisi

No Issues
This commit is contained in:
2025-07-09 16:42:05 +08:00
parent 2e9a5bcd74
commit adf8fcf8f6
9 changed files with 215 additions and 35 deletions

View File

@@ -175,8 +175,8 @@ export async function POST(request: Request) {
subscription: true
}
},
TokenDeviceUser:{
select:{
TokenDeviceUser: {
select: {
token: true
}
}
@@ -228,8 +228,8 @@ export async function POST(request: Request) {
subscription: true
}
},
TokenDeviceUser:{
select:{
TokenDeviceUser: {
select: {
token: true
}
}
@@ -255,7 +255,6 @@ export async function POST(request: Request) {
const pushNotif = dataPush.filter((item) => item.subscription != undefined)
const sendWebPush = await funSendWebPush({ sub: pushNotif, message: { title: 'Pengumuman Baru', body: 'Anda memiliki pengumuman baru. Silahkan periksa detailnya.' } })
@@ -263,13 +262,13 @@ export async function POST(request: Request) {
data: dataNotif
})
const tokenUnique = [...new Set(tokenDup)];
const tokenUnique = [...new Set(tokenDup.flat())];
await sendFCMNotificationMany({
token: tokenUnique,
title: "Pengumuman Baru",
body: "Anda memiliki pengumuman baru. Silahkan periksa detailnya.",
data: { id: data.id, category: "announcement", content: data.id }
})
})
// create log user
const log = await createLogUserMobile({ act: 'CREATE', desc: 'User membuat data pengumuman baru', table: 'announcement', data: data.id, user: userMobile.id })