Merge pull request 'join' (#23) from join into staging
Reviewed-on: bip/sistem-desa-mandiri#23
This commit is contained in:
@@ -209,6 +209,8 @@ export async function POST(request: Request) {
|
||||
})
|
||||
}
|
||||
|
||||
dataNotif.filter((v: any) => v.idUserTo != undefined && v.idUserTo != null && v.idUserTo != "" && v.idUserTo != userId)
|
||||
|
||||
const insertNotif = await prisma.notifications.createMany({
|
||||
data: dataNotif
|
||||
})
|
||||
|
||||
@@ -260,6 +260,8 @@ export async function POST(request: Request) {
|
||||
})
|
||||
}
|
||||
|
||||
dataNotif.filter((v: any) => v.idUserTo != undefined && v.idUserTo != null && v.idUserTo != "" && v.idUserTo != userId)
|
||||
|
||||
const pushNotif = dataPush.filter((item) => item.subscription != undefined)
|
||||
|
||||
const sendWebPush = await funSendWebPush({ sub: pushNotif, message: { body: 'Terdapat diskusi baru. Silahkan periksa detailnya.', title: 'Diskusi Baru' } })
|
||||
|
||||
@@ -313,6 +313,7 @@ export async function POST(request: Request) {
|
||||
tokenDup.push(...omitFCM.map((v: any) => v.tokens).flat())
|
||||
}
|
||||
|
||||
dataNotif.filter((v: any) => v.idUserTo != undefined && v.idUserTo != null && v.idUserTo != "" && v.idUserTo != userId)
|
||||
|
||||
const pushNotif = dataPush.filter((item) => item.subscription != undefined)
|
||||
|
||||
|
||||
@@ -355,6 +355,7 @@ export async function POST(request: Request) {
|
||||
})
|
||||
}
|
||||
|
||||
dataNotif.filter((v: any) => v.idUserTo != undefined && v.idUserTo != null && v.idUserTo != "" && v.idUserTo != userId)
|
||||
const pushNotif = dataPush.filter((item) => item.subscription != undefined)
|
||||
|
||||
const sendWebPush = await funSendWebPush({ sub: pushNotif, message: { body: 'Terdapat tugas baru. Silahkan periksa detailnya.', title: 'Tugas Baru' } })
|
||||
|
||||
@@ -2,7 +2,7 @@ import { NextResponse } from "next/server";
|
||||
|
||||
export async function GET(request: Request) {
|
||||
try {
|
||||
return NextResponse.json({ success: true, version: "1.7.1", tahap: "beta", update: "-api mobile; -tambah laporan pada project dan tugas divisi; -tambah upload link pada project dan tugas divisi; -tambah detail tanggal dan jam pada project dan tugas divisi" }, { status: 200 });
|
||||
return NextResponse.json({ success: true, version: "1.7.2", tahap: "beta", update: "-api mobile; -tambah laporan pada project dan tugas divisi; -tambah upload link pada project dan tugas divisi; -tambah detail tanggal dan jam pada project dan tugas divisi" }, { status: 200 });
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
return NextResponse.json({ success: false, version: "Gagal mendapatkan version, coba lagi nanti (error: 500)", reason: (error as Error).message, }, { status: 500 });
|
||||
|
||||
Reference in New Issue
Block a user