upd: notif insert

Deskripsi:
- mengganti kalimat notifikasi sesuai dengan content yg diinputkan
- upd api version

No Issues
This commit is contained in:
2025-09-30 14:40:37 +08:00
parent 6910f8fdff
commit 9a6a4d66df
15 changed files with 67 additions and 60 deletions

View File

@@ -119,11 +119,13 @@ export async function POST(request: Request, context: { params: { id: string } }
tokenDup.push(perbekel?.TokenDeviceUser.map((v: any) => v.token).flat())
}
const commentNotif = comment.length > 300 ? comment.substring(0, 300) + '...' : comment;
const tokenUnique = [...new Set(tokenDup.flat())].filter((v: any) => v != undefined && v != null && v != "");
await sendFCMNotificationMany({
token: tokenUnique,
title: "Komentar Baru",
body: `${userSent?.name}: ${comment}`,
body: `${userSent?.name}: ${commentNotif}`,
data: { id: data.id, category: `division/${dataDivision?.idDivision}/discussion`, content: id }
})