upd: api mobile
Deskripsi: - tambah project No Issues
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { title } from 'process';
|
||||
import { DIR, funSendWebPush, funUploadFile, prisma } from "@/module/_global";
|
||||
import { funGetUserById } from "@/module/auth";
|
||||
import { createLogUserMobile } from "@/module/user";
|
||||
@@ -179,13 +180,14 @@ export async function POST(request: Request) {
|
||||
|
||||
if (task.length > 0) {
|
||||
const dataProject = task.map((v: any) => ({
|
||||
..._.omit(v, ["dateStart", "dateEnd", "name"]),
|
||||
..._.omit(v, ["dateStart", "dateEnd", "name", "dateEndFix", "dateStartFix"]),
|
||||
idProject: data.id,
|
||||
title: v.title,
|
||||
dateStart: new Date(v.dateStart),
|
||||
dateEnd: new Date(v.dateEnd),
|
||||
dateStart: new Date(v.dateStartFix),
|
||||
dateEnd: new Date(v.dateEndFix),
|
||||
}))
|
||||
|
||||
|
||||
const insertTask = await prisma.projectTask.createMany({
|
||||
data: dataProject
|
||||
})
|
||||
@@ -337,7 +339,7 @@ export async function POST(request: Request) {
|
||||
|
||||
const pushNotif = dataPush.filter((item) => item.subscription != undefined)
|
||||
|
||||
const sendWebPush = await funSendWebPush({ sub: pushNotif, message: { title: 'Kegiatan Baru', body: 'Terdapat kegiatan baru. Silahkan periksa detailnya.' } })
|
||||
// const sendWebPush = await funSendWebPush({ sub: pushNotif, message: { title: 'Kegiatan Baru', body: 'Terdapat kegiatan baru. Silahkan periksa detailnya.' } })
|
||||
const insertNotif = await prisma.notifications.createMany({
|
||||
data: dataNotif
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user