Merge pull request 'join' (#54) from join into staging
Reviewed-on: bip/sistem-desa-mandiri#54
This commit is contained in:
@@ -184,7 +184,7 @@ export async function POST(request: Request) {
|
|||||||
category: 'announcement',
|
category: 'announcement',
|
||||||
idContent: data.id,
|
idContent: data.id,
|
||||||
title: 'Pengumuman Baru',
|
title: 'Pengumuman Baru',
|
||||||
desc: 'Anda memiliki pengumuman baru. Silahkan periksa detailnya.'
|
desc: title
|
||||||
}))
|
}))
|
||||||
|
|
||||||
const dataPush = memberNotif.map((v: any) => ({
|
const dataPush = memberNotif.map((v: any) => ({
|
||||||
@@ -217,7 +217,7 @@ export async function POST(request: Request) {
|
|||||||
category: 'announcement',
|
category: 'announcement',
|
||||||
idContent: data.id,
|
idContent: data.id,
|
||||||
title: 'Pengumuman Baru',
|
title: 'Pengumuman Baru',
|
||||||
desc: 'Anda memiliki pengumuman baru. Silahkan periksa detailnya.'
|
desc: title
|
||||||
})
|
})
|
||||||
|
|
||||||
dataPush.push({
|
dataPush.push({
|
||||||
@@ -229,7 +229,7 @@ export async function POST(request: Request) {
|
|||||||
|
|
||||||
const pushNotif = dataPush.filter((item) => item.subscription != undefined)
|
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.' } })
|
const sendWebPush = await funSendWebPush({ sub: pushNotif, message: { title: 'Pengumuman Baru', body: title } })
|
||||||
const insertNotif = await prisma.notifications.createMany({
|
const insertNotif = await prisma.notifications.createMany({
|
||||||
data: dataNotif
|
data: dataNotif
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ export async function POST(request: Request) {
|
|||||||
category: 'discussion',
|
category: 'discussion',
|
||||||
idContent: data.id,
|
idContent: data.id,
|
||||||
title: 'Diskusi Umum Baru',
|
title: 'Diskusi Umum Baru',
|
||||||
desc: 'Terdapat diskusi umum baru. Silahkan periksa detailnya.'
|
desc: title
|
||||||
}))
|
}))
|
||||||
|
|
||||||
if (userRoleLogin != "supadmin") {
|
if (userRoleLogin != "supadmin") {
|
||||||
@@ -173,7 +173,7 @@ export async function POST(request: Request) {
|
|||||||
category: 'discussion',
|
category: 'discussion',
|
||||||
idContent: data.id,
|
idContent: data.id,
|
||||||
title: 'Diskusi Umum Baru',
|
title: 'Diskusi Umum Baru',
|
||||||
desc: 'Terdapat diskusi umum baru. Silahkan periksa detailnya.'
|
desc: title
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -146,6 +146,8 @@ export async function POST(request: Request) {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const descNotif = desc.length > 300 ? desc.substring(0, 300) + '...' : desc
|
||||||
|
|
||||||
|
|
||||||
// mengirim notifikasi
|
// mengirim notifikasi
|
||||||
// datanotif untuk realtime notifikasi
|
// datanotif untuk realtime notifikasi
|
||||||
@@ -157,7 +159,7 @@ export async function POST(request: Request) {
|
|||||||
category: 'division/' + idDivision + '/discussion',
|
category: 'division/' + idDivision + '/discussion',
|
||||||
idContent: data.id,
|
idContent: data.id,
|
||||||
title: 'Diskusi Baru',
|
title: 'Diskusi Baru',
|
||||||
desc: 'Terdapat diskusi baru. Silahkan periksa detailnya.'
|
desc: descNotif
|
||||||
}))
|
}))
|
||||||
|
|
||||||
const dataPush = memberDivision.map((v: any) => ({
|
const dataPush = memberDivision.map((v: any) => ({
|
||||||
@@ -189,7 +191,7 @@ export async function POST(request: Request) {
|
|||||||
category: 'division/' + idDivision + '/discussion',
|
category: 'division/' + idDivision + '/discussion',
|
||||||
idContent: data.id,
|
idContent: data.id,
|
||||||
title: 'Diskusi Baru',
|
title: 'Diskusi Baru',
|
||||||
desc: 'Terdapat diskusi baru. Silahkan periksa detailnya.'
|
desc: descNotif
|
||||||
})
|
})
|
||||||
|
|
||||||
dataPush.push({
|
dataPush.push({
|
||||||
@@ -221,7 +223,7 @@ export async function POST(request: Request) {
|
|||||||
category: 'division/' + idDivision + '/discussion',
|
category: 'division/' + idDivision + '/discussion',
|
||||||
idContent: data.id,
|
idContent: data.id,
|
||||||
title: 'Diskusi Baru',
|
title: 'Diskusi Baru',
|
||||||
desc: 'Terdapat diskusi baru. Silahkan periksa detailnya.'
|
desc: descNotif
|
||||||
})
|
})
|
||||||
|
|
||||||
dataPush.push({
|
dataPush.push({
|
||||||
@@ -232,7 +234,7 @@ export async function POST(request: Request) {
|
|||||||
|
|
||||||
const pushNotif = dataPush.filter((item) => item.subscription != undefined)
|
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' } })
|
const sendWebPush = await funSendWebPush({ sub: pushNotif, message: { body: descNotif, title: 'Diskusi Baru' } })
|
||||||
const insertNotif = await prisma.notifications.createMany({
|
const insertNotif = await prisma.notifications.createMany({
|
||||||
data: dataNotif
|
data: dataNotif
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -174,7 +174,7 @@ export async function POST(request: Request) {
|
|||||||
category: 'division',
|
category: 'division',
|
||||||
idContent: data.id,
|
idContent: data.id,
|
||||||
title: 'Divisi Baru',
|
title: 'Divisi Baru',
|
||||||
desc: 'Terdapat divisi baru. Silahkan periksa detailnya.'
|
desc: `Divisi ${sent.data.name} telah dibuat. Silakan periksa detailnya.`
|
||||||
}))
|
}))
|
||||||
|
|
||||||
const selectUser = await prisma.divisionMember.findMany({
|
const selectUser = await prisma.divisionMember.findMany({
|
||||||
@@ -225,7 +225,7 @@ export async function POST(request: Request) {
|
|||||||
category: 'division',
|
category: 'division',
|
||||||
idContent: data.id,
|
idContent: data.id,
|
||||||
title: 'Divisi Baru',
|
title: 'Divisi Baru',
|
||||||
desc: 'Terdapat divisi baru. Silahkan periksa detailnya.'
|
desc: `Divisi ${sent.data.name} telah dibuat. Silakan periksa detailnya.`
|
||||||
})
|
})
|
||||||
|
|
||||||
dataPush.push({
|
dataPush.push({
|
||||||
@@ -262,7 +262,7 @@ export async function POST(request: Request) {
|
|||||||
category: 'division',
|
category: 'division',
|
||||||
idContent: data.id,
|
idContent: data.id,
|
||||||
title: 'Divisi Baru',
|
title: 'Divisi Baru',
|
||||||
desc: 'Terdapat divisi baru. Silahkan periksa detailnya.'
|
desc: `Divisi ${sent.data.name} telah dibuat. Silakan periksa detailnya.`
|
||||||
}))
|
}))
|
||||||
|
|
||||||
const omitPush = atasanGroup.map((v: any) => ({
|
const omitPush = atasanGroup.map((v: any) => ({
|
||||||
@@ -279,7 +279,7 @@ export async function POST(request: Request) {
|
|||||||
|
|
||||||
const pushNotif = dataPush.filter((item) => item.subscription != undefined)
|
const pushNotif = dataPush.filter((item) => item.subscription != undefined)
|
||||||
|
|
||||||
const sendWebPush = await funSendWebPush({ sub: pushNotif, message: { title: 'Divisi Baru', body: 'Terdapat divisi baru. Silahkan periksa detailnya.' } })
|
const sendWebPush = await funSendWebPush({ sub: pushNotif, message: { title: 'Divisi Baru', body: `Divisi ${sent.data.name} telah dibuat. Silakan periksa detailnya.` } })
|
||||||
const insertNotif = await prisma.notifications.createMany({
|
const insertNotif = await prisma.notifications.createMany({
|
||||||
data: dataNotif
|
data: dataNotif
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -203,7 +203,7 @@ export async function POST(request: Request) {
|
|||||||
category: 'announcement',
|
category: 'announcement',
|
||||||
idContent: data.id,
|
idContent: data.id,
|
||||||
title: 'Pengumuman Baru',
|
title: 'Pengumuman Baru',
|
||||||
desc: 'Anda memiliki pengumuman baru. Silahkan periksa detailnya.'
|
desc: title
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
|
||||||
@@ -244,7 +244,7 @@ export async function POST(request: Request) {
|
|||||||
category: 'announcement',
|
category: 'announcement',
|
||||||
idContent: data.id,
|
idContent: data.id,
|
||||||
title: 'Pengumuman Baru',
|
title: 'Pengumuman Baru',
|
||||||
desc: 'Anda memiliki pengumuman baru. Silahkan periksa detailnya.'
|
desc: title
|
||||||
})
|
})
|
||||||
|
|
||||||
dataPush.push({
|
dataPush.push({
|
||||||
@@ -258,7 +258,7 @@ export async function POST(request: Request) {
|
|||||||
|
|
||||||
const pushNotif = dataPush.filter((item) => item.subscription != undefined)
|
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.' } })
|
const sendWebPush = await funSendWebPush({ sub: pushNotif, message: { title: 'Pengumuman Baru', body: title } })
|
||||||
const insertNotif = await prisma.notifications.createMany({
|
const insertNotif = await prisma.notifications.createMany({
|
||||||
data: dataNotifFilter
|
data: dataNotifFilter
|
||||||
})
|
})
|
||||||
@@ -267,7 +267,7 @@ export async function POST(request: Request) {
|
|||||||
await sendFCMNotificationMany({
|
await sendFCMNotificationMany({
|
||||||
token: tokenUnique,
|
token: tokenUnique,
|
||||||
title: "Pengumuman Baru",
|
title: "Pengumuman Baru",
|
||||||
body: "Anda memiliki pengumuman baru. Silahkan periksa detailnya.",
|
body: title,
|
||||||
data: { id: data.id, category: "announcement", content: data.id }
|
data: { id: data.id, category: "announcement", content: data.id }
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -103,11 +103,13 @@ export async function POST(request: Request, context: { params: { id: string } }
|
|||||||
tokenDup.push(perbekel?.TokenDeviceUser.map((v: any) => v.token).flat())
|
tokenDup.push(perbekel?.TokenDeviceUser.map((v: any) => v.token).flat())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const commentNotif = data.comment.length > 300 ? data.comment.substring(0, 300) + '...' : data.comment;
|
||||||
|
|
||||||
const tokenUnique = [...new Set(tokenDup.flat())].filter((v: any) => v != undefined && v != null && v != "");
|
const tokenUnique = [...new Set(tokenDup.flat())].filter((v: any) => v != undefined && v != null && v != "");
|
||||||
await sendFCMNotificationMany({
|
await sendFCMNotificationMany({
|
||||||
token: tokenUnique,
|
token: tokenUnique,
|
||||||
title: "Komentar Baru",
|
title: "Komentar Baru",
|
||||||
body: `${userSent?.name}: ${data.comment}`,
|
body: `${userSent?.name}: ${commentNotif}`,
|
||||||
data: { id: data.id, category: "discussion-general", content: id }
|
data: { id: data.id, category: "discussion-general", content: id }
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ export async function POST(request: Request) {
|
|||||||
category: 'discussion',
|
category: 'discussion',
|
||||||
idContent: data.id,
|
idContent: data.id,
|
||||||
title: 'Diskusi Umum Baru',
|
title: 'Diskusi Umum Baru',
|
||||||
desc: 'Terdapat diskusi umum baru. Silahkan periksa detailnya.'
|
desc: title
|
||||||
}))
|
}))
|
||||||
|
|
||||||
if (userRoleLogin != "supadmin") {
|
if (userRoleLogin != "supadmin") {
|
||||||
@@ -205,7 +205,7 @@ export async function POST(request: Request) {
|
|||||||
category: 'discussion',
|
category: 'discussion',
|
||||||
idContent: data.id,
|
idContent: data.id,
|
||||||
title: 'Diskusi Umum Baru',
|
title: 'Diskusi Umum Baru',
|
||||||
desc: 'Terdapat diskusi umum baru. Silahkan periksa detailnya.'
|
desc: title
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -219,7 +219,7 @@ export async function POST(request: Request) {
|
|||||||
await sendFCMNotificationMany({
|
await sendFCMNotificationMany({
|
||||||
token: tokenUnique,
|
token: tokenUnique,
|
||||||
title: "Diskusi Umum Baru",
|
title: "Diskusi Umum Baru",
|
||||||
body: "Anda memiliki diskusi umum baru. Silahkan periksa detailnya.",
|
body: title,
|
||||||
data: { id: data.id, category: "discussion", content: data.id }
|
data: { id: data.id, category: "discussion", content: data.id }
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -119,11 +119,13 @@ export async function POST(request: Request, context: { params: { id: string } }
|
|||||||
tokenDup.push(perbekel?.TokenDeviceUser.map((v: any) => v.token).flat())
|
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 != "");
|
const tokenUnique = [...new Set(tokenDup.flat())].filter((v: any) => v != undefined && v != null && v != "");
|
||||||
await sendFCMNotificationMany({
|
await sendFCMNotificationMany({
|
||||||
token: tokenUnique,
|
token: tokenUnique,
|
||||||
title: "Komentar Baru",
|
title: "Komentar Baru",
|
||||||
body: `${userSent?.name}: ${comment}`,
|
body: `${userSent?.name}: ${commentNotif}`,
|
||||||
data: { id: data.id, category: `division/${dataDivision?.idDivision}/discussion`, content: id }
|
data: { id: data.id, category: `division/${dataDivision?.idDivision}/discussion`, content: id }
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -155,6 +155,8 @@ export async function POST(request: Request) {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const deskripsiNotif = desc.length > 300 ? desc.substring(0, 300) + '...' : desc;
|
||||||
|
|
||||||
|
|
||||||
// mengirim notifikasi
|
// mengirim notifikasi
|
||||||
// dataFCM untuk push notifikasi mobile
|
// dataFCM untuk push notifikasi mobile
|
||||||
@@ -173,7 +175,7 @@ export async function POST(request: Request) {
|
|||||||
category: 'division/' + idDivision + '/discussion',
|
category: 'division/' + idDivision + '/discussion',
|
||||||
idContent: data.id,
|
idContent: data.id,
|
||||||
title: 'Diskusi Baru',
|
title: 'Diskusi Baru',
|
||||||
desc: 'Terdapat diskusi baru. Silahkan periksa detailnya.'
|
desc: deskripsiNotif
|
||||||
}))
|
}))
|
||||||
|
|
||||||
const dataPush = memberDivision.map((v: any) => ({
|
const dataPush = memberDivision.map((v: any) => ({
|
||||||
@@ -212,7 +214,7 @@ export async function POST(request: Request) {
|
|||||||
category: 'division/' + idDivision + '/discussion',
|
category: 'division/' + idDivision + '/discussion',
|
||||||
idContent: data.id,
|
idContent: data.id,
|
||||||
title: 'Diskusi Baru',
|
title: 'Diskusi Baru',
|
||||||
desc: 'Terdapat diskusi baru. Silahkan periksa detailnya.'
|
desc: deskripsiNotif
|
||||||
})
|
})
|
||||||
|
|
||||||
dataPush.push({
|
dataPush.push({
|
||||||
@@ -251,7 +253,7 @@ export async function POST(request: Request) {
|
|||||||
category: 'division/' + idDivision + '/discussion',
|
category: 'division/' + idDivision + '/discussion',
|
||||||
idContent: data.id,
|
idContent: data.id,
|
||||||
title: 'Diskusi Baru',
|
title: 'Diskusi Baru',
|
||||||
desc: 'Terdapat diskusi baru. Silahkan periksa detailnya.'
|
desc: deskripsiNotif
|
||||||
})
|
})
|
||||||
|
|
||||||
dataPush.push({
|
dataPush.push({
|
||||||
@@ -264,7 +266,7 @@ export async function POST(request: Request) {
|
|||||||
|
|
||||||
const pushNotif = dataPush.filter((item) => item.subscription != undefined)
|
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' } })
|
const sendWebPush = await funSendWebPush({ sub: pushNotif, message: { body: deskripsiNotif, title: 'Diskusi Baru' } })
|
||||||
const insertNotif = await prisma.notifications.createMany({
|
const insertNotif = await prisma.notifications.createMany({
|
||||||
data: dataNotifFilter
|
data: dataNotifFilter
|
||||||
})
|
})
|
||||||
@@ -274,7 +276,7 @@ export async function POST(request: Request) {
|
|||||||
await sendFCMNotificationMany({
|
await sendFCMNotificationMany({
|
||||||
token: tokenUnique,
|
token: tokenUnique,
|
||||||
title: "Diskusi Baru",
|
title: "Diskusi Baru",
|
||||||
body: "Anda memiliki diskusi baru. Silahkan periksa detailnya.",
|
body: deskripsiNotif,
|
||||||
data: { id: data.id, category: "division/" + idDivision + "/discussion", content: data.id }
|
data: { id: data.id, category: "division/" + idDivision + "/discussion", content: data.id }
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ export async function POST(request: Request) {
|
|||||||
category: 'division',
|
category: 'division',
|
||||||
idContent: data.id,
|
idContent: data.id,
|
||||||
title: 'Divisi Baru',
|
title: 'Divisi Baru',
|
||||||
desc: 'Terdapat divisi baru. Silahkan periksa detailnya.'
|
desc: `Divisi ${sent.data.name} telah dibuat. Silakan periksa detailnya.`
|
||||||
}))
|
}))
|
||||||
|
|
||||||
const selectUser = await prisma.divisionMember.findMany({
|
const selectUser = await prisma.divisionMember.findMany({
|
||||||
@@ -252,7 +252,7 @@ export async function POST(request: Request) {
|
|||||||
category: 'division',
|
category: 'division',
|
||||||
idContent: data.id,
|
idContent: data.id,
|
||||||
title: 'Divisi Baru',
|
title: 'Divisi Baru',
|
||||||
desc: 'Terdapat divisi baru. Silahkan periksa detailnya.'
|
desc: `Divisi ${sent.data.name} telah dibuat. Silakan periksa detailnya.`
|
||||||
})
|
})
|
||||||
|
|
||||||
dataPush.push({
|
dataPush.push({
|
||||||
@@ -299,7 +299,7 @@ export async function POST(request: Request) {
|
|||||||
category: 'division',
|
category: 'division',
|
||||||
idContent: data.id,
|
idContent: data.id,
|
||||||
title: 'Divisi Baru',
|
title: 'Divisi Baru',
|
||||||
desc: 'Terdapat divisi baru. Silahkan periksa detailnya.'
|
desc: `Divisi ${sent.data.name} telah dibuat. Silakan periksa detailnya.`
|
||||||
}))
|
}))
|
||||||
|
|
||||||
const omitPush = atasanGroup.map((v: any) => ({
|
const omitPush = atasanGroup.map((v: any) => ({
|
||||||
@@ -317,7 +317,7 @@ export async function POST(request: Request) {
|
|||||||
|
|
||||||
const pushNotif = dataPush.filter((item) => item.subscription != undefined)
|
const pushNotif = dataPush.filter((item) => item.subscription != undefined)
|
||||||
|
|
||||||
const sendWebPush = await funSendWebPush({ sub: pushNotif, message: { title: 'Divisi Baru', body: 'Terdapat divisi baru. Silahkan periksa detailnya.' } })
|
const sendWebPush = await funSendWebPush({ sub: pushNotif, message: { title: 'Divisi Baru', body: `Divisi ${sent.data.name} telah dibuat. Silakan periksa detailnya.` } })
|
||||||
const insertNotif = await prisma.notifications.createMany({
|
const insertNotif = await prisma.notifications.createMany({
|
||||||
data: dataNotifFilter
|
data: dataNotifFilter
|
||||||
})
|
})
|
||||||
@@ -326,7 +326,7 @@ export async function POST(request: Request) {
|
|||||||
await sendFCMNotificationMany({
|
await sendFCMNotificationMany({
|
||||||
token: tokenUnique,
|
token: tokenUnique,
|
||||||
title: "Divisi Baru",
|
title: "Divisi Baru",
|
||||||
body: "Anda memiliki divisi baru. Silahkan periksa detailnya.",
|
body: `Divisi ${sent.data.name} telah dibuat. Silakan periksa detailnya.`,
|
||||||
data: { id: data.id, category: "division", content: data.id }
|
data: { id: data.id, category: "division", content: data.id }
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -284,7 +284,7 @@ export async function POST(request: Request) {
|
|||||||
category: 'project',
|
category: 'project',
|
||||||
idContent: data.id,
|
idContent: data.id,
|
||||||
title: 'Kegiatan Baru',
|
title: 'Kegiatan Baru',
|
||||||
desc: 'Terdapat kegiatan baru. Silahkan periksa detailnya.'
|
desc: title
|
||||||
}))
|
}))
|
||||||
|
|
||||||
const dataPush = memberNotif.map((v: any) => ({
|
const dataPush = memberNotif.map((v: any) => ({
|
||||||
@@ -323,7 +323,7 @@ export async function POST(request: Request) {
|
|||||||
category: 'project',
|
category: 'project',
|
||||||
idContent: data.id,
|
idContent: data.id,
|
||||||
title: 'Kegiatan Baru',
|
title: 'Kegiatan Baru',
|
||||||
desc: 'Terdapat kegiatan baru. Silahkan periksa detailnya.'
|
desc: title
|
||||||
})
|
})
|
||||||
|
|
||||||
dataPush.push({
|
dataPush.push({
|
||||||
@@ -370,7 +370,7 @@ export async function POST(request: Request) {
|
|||||||
category: 'project',
|
category: 'project',
|
||||||
idContent: data.id,
|
idContent: data.id,
|
||||||
title: 'Kegiatan Baru',
|
title: 'Kegiatan Baru',
|
||||||
desc: 'Terdapat kegiatan baru. Silahkan periksa detailnya.'
|
desc: title
|
||||||
}))
|
}))
|
||||||
|
|
||||||
const omitPush = atasanGroup.map((v: any) => ({
|
const omitPush = atasanGroup.map((v: any) => ({
|
||||||
@@ -387,7 +387,7 @@ export async function POST(request: Request) {
|
|||||||
const dataNotifFilter = dataNotif.filter((item) => item.idUserTo != undefined && item.idUserTo != null && item.idUserTo != "" && item.idUserTo != userId)
|
const dataNotifFilter = dataNotif.filter((item) => item.idUserTo != undefined && item.idUserTo != null && item.idUserTo != "" && item.idUserTo != userId)
|
||||||
const pushNotif = dataPush.filter((item) => item.subscription != undefined)
|
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: title } })
|
||||||
const insertNotif = await prisma.notifications.createMany({
|
const insertNotif = await prisma.notifications.createMany({
|
||||||
data: dataNotifFilter
|
data: dataNotifFilter
|
||||||
})
|
})
|
||||||
@@ -396,7 +396,7 @@ export async function POST(request: Request) {
|
|||||||
await sendFCMNotificationMany({
|
await sendFCMNotificationMany({
|
||||||
token: tokenUnique,
|
token: tokenUnique,
|
||||||
title: "Kegiatan Baru",
|
title: "Kegiatan Baru",
|
||||||
body: "Anda memiliki kegiatan baru. Silahkan periksa detailnya.",
|
body: title,
|
||||||
data: { id: data.id, category: "project", content: data.id }
|
data: { id: data.id, category: "project", content: data.id }
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -267,8 +267,8 @@ export async function POST(request: Request) {
|
|||||||
idUserFrom: String(userMobile.id),
|
idUserFrom: String(userMobile.id),
|
||||||
category: 'division/' + idDivision + '/task',
|
category: 'division/' + idDivision + '/task',
|
||||||
idContent: data.id,
|
idContent: data.id,
|
||||||
title: 'Tugas Baru',
|
title: 'Tugas Divisi Baru',
|
||||||
desc: 'Terdapat tugas baru. Silahkan periksa detailnya.'
|
desc: title
|
||||||
}))
|
}))
|
||||||
|
|
||||||
const dataPush = memberDivision.map((v: any) => ({
|
const dataPush = memberDivision.map((v: any) => ({
|
||||||
@@ -306,8 +306,8 @@ export async function POST(request: Request) {
|
|||||||
idUserFrom: userId,
|
idUserFrom: userId,
|
||||||
category: 'division/' + idDivision + '/task',
|
category: 'division/' + idDivision + '/task',
|
||||||
idContent: data.id,
|
idContent: data.id,
|
||||||
title: 'Tugas Baru',
|
title: 'Tugas Divisi Baru',
|
||||||
desc: 'Terdapat tugas baru. Silahkan periksa detailnya.'
|
desc: title
|
||||||
})
|
})
|
||||||
|
|
||||||
dataPush.push({
|
dataPush.push({
|
||||||
@@ -345,8 +345,8 @@ export async function POST(request: Request) {
|
|||||||
idUserFrom: userId,
|
idUserFrom: userId,
|
||||||
category: 'division/' + idDivision + '/task',
|
category: 'division/' + idDivision + '/task',
|
||||||
idContent: data.id,
|
idContent: data.id,
|
||||||
title: 'Tugas Baru',
|
title: 'Tugas Divisi Baru',
|
||||||
desc: 'Terdapat tugas baru. Silahkan periksa detailnya.'
|
desc: title
|
||||||
})
|
})
|
||||||
|
|
||||||
dataPush.push({
|
dataPush.push({
|
||||||
@@ -358,7 +358,7 @@ export async function POST(request: Request) {
|
|||||||
const dataNotifFilter = dataNotif.filter((v: any) => v.idUserTo != undefined && v.idUserTo != null && v.idUserTo != "" && v.idUserTo != userId)
|
const dataNotifFilter = dataNotif.filter((v: any) => v.idUserTo != undefined && v.idUserTo != null && v.idUserTo != "" && v.idUserTo != userId)
|
||||||
const pushNotif = dataPush.filter((item) => item.subscription != undefined)
|
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' } })
|
const sendWebPush = await funSendWebPush({ sub: pushNotif, message: { body: title, title: 'Tugas Divisi Baru' } })
|
||||||
const insertNotif = await prisma.notifications.createMany({
|
const insertNotif = await prisma.notifications.createMany({
|
||||||
data: dataNotifFilter
|
data: dataNotifFilter
|
||||||
})
|
})
|
||||||
@@ -366,8 +366,8 @@ export async function POST(request: Request) {
|
|||||||
const tokenUnique = [...new Set(tokenDup.flat())].filter((v: any) => v != undefined && v != null && v != "");
|
const tokenUnique = [...new Set(tokenDup.flat())].filter((v: any) => v != undefined && v != null && v != "");
|
||||||
await sendFCMNotificationMany({
|
await sendFCMNotificationMany({
|
||||||
token: tokenUnique,
|
token: tokenUnique,
|
||||||
title: "Tugas Baru",
|
title: "Tugas Divisi Baru",
|
||||||
body: "Anda memiliki tugas baru. Silahkan periksa detailnya.",
|
body: title,
|
||||||
data: { id: data.id, category: 'division/' + idDivision + '/task', content: data.id }
|
data: { id: data.id, category: 'division/' + idDivision + '/task', content: data.id }
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -262,7 +262,7 @@ export async function POST(request: Request) {
|
|||||||
category: 'project',
|
category: 'project',
|
||||||
idContent: data.id,
|
idContent: data.id,
|
||||||
title: 'Kegiatan Baru',
|
title: 'Kegiatan Baru',
|
||||||
desc: 'Terdapat kegiatan baru. Silahkan periksa detailnya.'
|
desc: title
|
||||||
}))
|
}))
|
||||||
|
|
||||||
const dataPush = memberNotif.map((v: any) => ({
|
const dataPush = memberNotif.map((v: any) => ({
|
||||||
@@ -294,7 +294,7 @@ export async function POST(request: Request) {
|
|||||||
category: 'project',
|
category: 'project',
|
||||||
idContent: data.id,
|
idContent: data.id,
|
||||||
title: 'Kegiatan Baru',
|
title: 'Kegiatan Baru',
|
||||||
desc: 'Terdapat kegiatan baru. Silahkan periksa detailnya.'
|
desc: title
|
||||||
})
|
})
|
||||||
|
|
||||||
dataPush.push({
|
dataPush.push({
|
||||||
@@ -330,7 +330,7 @@ export async function POST(request: Request) {
|
|||||||
category: 'project',
|
category: 'project',
|
||||||
idContent: data.id,
|
idContent: data.id,
|
||||||
title: 'Kegiatan Baru',
|
title: 'Kegiatan Baru',
|
||||||
desc: 'Terdapat kegiatan baru. Silahkan periksa detailnya.'
|
desc: title
|
||||||
}))
|
}))
|
||||||
|
|
||||||
const omitPush = atasanGroup.map((v: any) => ({
|
const omitPush = atasanGroup.map((v: any) => ({
|
||||||
@@ -346,7 +346,7 @@ export async function POST(request: Request) {
|
|||||||
|
|
||||||
const pushNotif = dataPush.filter((item) => item.subscription != undefined)
|
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: title } })
|
||||||
const insertNotif = await prisma.notifications.createMany({
|
const insertNotif = await prisma.notifications.createMany({
|
||||||
data: dataNotif
|
data: dataNotif
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -253,8 +253,8 @@ export async function POST(request: Request) {
|
|||||||
idUserFrom: String(user.id),
|
idUserFrom: String(user.id),
|
||||||
category: 'division/' + idDivision + '/task',
|
category: 'division/' + idDivision + '/task',
|
||||||
idContent: data.id,
|
idContent: data.id,
|
||||||
title: 'Tugas Baru',
|
title: 'Tugas Divisi Baru',
|
||||||
desc: 'Terdapat tugas baru. Silahkan periksa detailnya.'
|
desc: title
|
||||||
}))
|
}))
|
||||||
|
|
||||||
const dataPush = memberDivision.map((v: any) => ({
|
const dataPush = memberDivision.map((v: any) => ({
|
||||||
@@ -285,8 +285,8 @@ export async function POST(request: Request) {
|
|||||||
idUserFrom: userId,
|
idUserFrom: userId,
|
||||||
category: 'division/' + idDivision + '/task',
|
category: 'division/' + idDivision + '/task',
|
||||||
idContent: data.id,
|
idContent: data.id,
|
||||||
title: 'Tugas Baru',
|
title: 'Tugas Divisi Baru',
|
||||||
desc: 'Terdapat tugas baru. Silahkan periksa detailnya.'
|
desc: title
|
||||||
})
|
})
|
||||||
|
|
||||||
dataPush.push({
|
dataPush.push({
|
||||||
@@ -317,8 +317,8 @@ export async function POST(request: Request) {
|
|||||||
idUserFrom: userId,
|
idUserFrom: userId,
|
||||||
category: 'division/' + idDivision + '/task',
|
category: 'division/' + idDivision + '/task',
|
||||||
idContent: data.id,
|
idContent: data.id,
|
||||||
title: 'Tugas Baru',
|
title: 'Tugas Divisi Baru',
|
||||||
desc: 'Terdapat tugas baru. Silahkan periksa detailnya.'
|
desc: title
|
||||||
})
|
})
|
||||||
|
|
||||||
dataPush.push({
|
dataPush.push({
|
||||||
@@ -329,13 +329,12 @@ export async function POST(request: Request) {
|
|||||||
|
|
||||||
const pushNotif = dataPush.filter((item) => item.subscription != undefined)
|
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' } })
|
const sendWebPush = await funSendWebPush({ sub: pushNotif, message: { body: title, title: 'Tugas Divisi Baru' } })
|
||||||
const insertNotif = await prisma.notifications.createMany({
|
const insertNotif = await prisma.notifications.createMany({
|
||||||
data: dataNotif
|
data: dataNotif
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// create log userc
|
||||||
// create log user
|
|
||||||
const log = await createLogUser({ act: 'CREATE', desc: 'User membuat tugas divisi baru', table: 'divisionProject', data: data.id })
|
const log = await createLogUser({ act: 'CREATE', desc: 'User membuat tugas divisi baru', table: 'divisionProject', data: data.id })
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { NextResponse } from "next/server";
|
|||||||
|
|
||||||
export async function GET(request: Request) {
|
export async function GET(request: Request) {
|
||||||
try {
|
try {
|
||||||
return NextResponse.json({ success: true, version: "2.0.3", tahap: "beta", update: "-api mobile; -login tanpa otp (mobile app); -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; -api jenna ai; -privacy policy" }, { status: 200 });
|
return NextResponse.json({ success: true, version: "2.0.4", tahap: "beta", update: "-api mobile; -login tanpa otp (mobile app); -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; -api jenna ai; -privacy policy" }, { status: 200 });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(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 });
|
return NextResponse.json({ success: false, version: "Gagal mendapatkan version, coba lagi nanti (error: 500)", reason: (error as Error).message, }, { status: 500 });
|
||||||
|
|||||||
@@ -12,10 +12,10 @@ export const funGetAnnouncementById = async (path: string) => {
|
|||||||
|
|
||||||
export const funCreateAnnouncement = async (data: IFormCreateAnnouncement) => {
|
export const funCreateAnnouncement = async (data: IFormCreateAnnouncement) => {
|
||||||
if (data.title == "" || data.desc == "")
|
if (data.title == "" || data.desc == "")
|
||||||
return { success: false, message: 'Silahkan lengkapi form tambah pengumuman' }
|
return { success: false, message: 'Silakan lengkapi form tambah pengumuman' }
|
||||||
|
|
||||||
if (data.groups.length == 0)
|
if (data.groups.length == 0)
|
||||||
return { success: false, message: 'Silahkan pilih divisi penerima pengumuman' }
|
return { success: false, message: 'Silakan pilih divisi penerima pengumuman' }
|
||||||
|
|
||||||
const response = await fetch("/api/announcement", {
|
const response = await fetch("/api/announcement", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
@@ -39,10 +39,10 @@ export const funDeleteAnnouncement = async (path: string) => {
|
|||||||
|
|
||||||
export const funEditAnnouncement = async (path: string, data: IFormCreateAnnouncement) => {
|
export const funEditAnnouncement = async (path: string, data: IFormCreateAnnouncement) => {
|
||||||
if (data.title == "" || data.desc == "")
|
if (data.title == "" || data.desc == "")
|
||||||
return { success: false, message: 'Silahkan lengkapi form edit pengumuman' }
|
return { success: false, message: 'Silakan lengkapi form edit pengumuman' }
|
||||||
|
|
||||||
if (data.groups.length == 0)
|
if (data.groups.length == 0)
|
||||||
return { success: false, message: 'Silahkan pilih divisi penerima pengumuman' }
|
return { success: false, message: 'Silakan pilih divisi penerima pengumuman' }
|
||||||
|
|
||||||
const response = await fetch(`/api/announcement/${path}`, {
|
const response = await fetch(`/api/announcement/${path}`, {
|
||||||
method: "PUT",
|
method: "PUT",
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ export default function CreateAnnouncement() {
|
|||||||
return false
|
return false
|
||||||
|
|
||||||
if (memberValue.length == 0)
|
if (memberValue.length == 0)
|
||||||
return toast.error("Error! silahkan pilih divisi")
|
return toast.error("Error! Silakan pilih divisi")
|
||||||
|
|
||||||
setOpen(true)
|
setOpen(true)
|
||||||
}, 500)
|
}, 500)
|
||||||
|
|||||||
@@ -180,7 +180,7 @@ function CreateBanner() {
|
|||||||
<Box mt={10}>
|
<Box mt={10}>
|
||||||
{touched.image && !imgForm && (
|
{touched.image && !imgForm && (
|
||||||
<Text size='sm' c={'red'}>
|
<Text size='sm' c={'red'}>
|
||||||
Silahkan Pilih Gambar
|
Silakan Pilih Gambar
|
||||||
</Text>
|
</Text>
|
||||||
)}
|
)}
|
||||||
</Box>
|
</Box>
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ export default function CreateCalenderDivisionCaleder() {
|
|||||||
return false
|
return false
|
||||||
|
|
||||||
if (memberValue.length == 0)
|
if (memberValue.length == 0)
|
||||||
return toast.error("Error! silahkan pilih anggota")
|
return toast.error("Error! Silakan pilih anggota")
|
||||||
|
|
||||||
setModal(true)
|
setModal(true)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ export default function CreateUserCalender({ onClose }: { onClose: (val: any) =>
|
|||||||
|
|
||||||
function onSubmit() {
|
function onSubmit() {
|
||||||
if (selectedFiles.length == 0) {
|
if (selectedFiles.length == 0) {
|
||||||
return toast.error("Error! silahkan pilih anggota")
|
return toast.error("Error! Silakan pilih anggota")
|
||||||
}
|
}
|
||||||
member.set(selectedFiles)
|
member.set(selectedFiles)
|
||||||
onClose(true)
|
onClose(true)
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ export default function CreateUserDetailCalender() {
|
|||||||
async function onSubmit() {
|
async function onSubmit() {
|
||||||
try {
|
try {
|
||||||
if (selectedFiles.length == 0) {
|
if (selectedFiles.length == 0) {
|
||||||
return toast.error("Error! silahkan pilih anggota")
|
return toast.error("Error! Silakan pilih anggota")
|
||||||
}
|
}
|
||||||
setLoadingSubmit(true)
|
setLoadingSubmit(true)
|
||||||
const res = await funAddMemberCalender(String(isDataCalender?.idCalendar), selectedFiles)
|
const res = await funAddMemberCalender(String(isDataCalender?.idCalendar), selectedFiles)
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ export default function UpdateDivisionCalender() {
|
|||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
toast.error("Terjadi kesalahan! Silahkan coba kembali");
|
toast.error("Terjadi kesalahan! Silakan coba kembali");
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false)
|
setLoading(false)
|
||||||
}
|
}
|
||||||
@@ -84,7 +84,7 @@ export default function UpdateDivisionCalender() {
|
|||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
toast.error("Terjadi kesalahan! Silahkan coba kembali");
|
toast.error("Terjadi kesalahan! Silakan coba kembali");
|
||||||
} finally {
|
} finally {
|
||||||
setModal(false)
|
setModal(false)
|
||||||
setLoadingModal(false)
|
setLoadingModal(false)
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ export default function UpdateListUsers({ onClose }: { onClose: (val: any) => vo
|
|||||||
|
|
||||||
function onSubmit() {
|
function onSubmit() {
|
||||||
if (selectedFiles.length == 0) {
|
if (selectedFiles.length == 0) {
|
||||||
return toast.error("Error! silahkan pilih anggota")
|
return toast.error("Error! Silakan pilih anggota")
|
||||||
}
|
}
|
||||||
member.set(selectedFiles)
|
member.set(selectedFiles)
|
||||||
onClose(true)
|
onClose(true)
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ export default function AddMemberDiscussionGeneral() {
|
|||||||
|
|
||||||
function onCheck() {
|
function onCheck() {
|
||||||
if (selectedFiles.length == 0) {
|
if (selectedFiles.length == 0) {
|
||||||
return toast.error("Error! silahkan pilih anggota")
|
return toast.error("Error! Silakan pilih anggota")
|
||||||
}
|
}
|
||||||
setOpen(true)
|
setOpen(true)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ export default function ChooseUsersDiscussion({ grup, onClose }: { grup?: string
|
|||||||
|
|
||||||
function onSubmit() {
|
function onSubmit() {
|
||||||
if (selectedFiles.length == 0) {
|
if (selectedFiles.length == 0) {
|
||||||
return toast.error("Error! silahkan pilih anggota")
|
return toast.error("Error! Silakan pilih anggota")
|
||||||
}
|
}
|
||||||
member.set(selectedFiles)
|
member.set(selectedFiles)
|
||||||
onClose(true)
|
onClose(true)
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ export default function FormCreateDiscussionGeneral() {
|
|||||||
return false
|
return false
|
||||||
|
|
||||||
if (memberValue.length <= 1)
|
if (memberValue.length <= 1)
|
||||||
return toast.error("Error! Silahkan pilih anggota lebih dari 1")
|
return toast.error("Error! Silakan pilih anggota lebih dari 1")
|
||||||
|
|
||||||
setModal(true)
|
setModal(true)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ export default function CreateAnggotaDivision() {
|
|||||||
|
|
||||||
function onCheck() {
|
function onCheck() {
|
||||||
if (selectedFiles.length == 0) {
|
if (selectedFiles.length == 0) {
|
||||||
return toast.error("Error! silahkan pilih anggota")
|
return toast.error("Error! Silakan pilih anggota")
|
||||||
}
|
}
|
||||||
setOpen(true)
|
setOpen(true)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,9 +51,9 @@ export default function CreateDivision() {
|
|||||||
return false
|
return false
|
||||||
|
|
||||||
if (member.length == 0)
|
if (member.length == 0)
|
||||||
return toast.error("Error! Silahkan pilih anggota")
|
return toast.error("Error! Silakan pilih anggota")
|
||||||
// if (member.length <= 1)
|
// if (member.length <= 1)
|
||||||
// return toast.error("Error! Silahkan pilih anggota lebih dari 1")
|
// return toast.error("Error! Silakan pilih anggota lebih dari 1")
|
||||||
|
|
||||||
setChooseAdmin(true)
|
setChooseAdmin(true)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ export default function NavbarAdminDivision({ data, onSuccess }: { data: any, on
|
|||||||
|
|
||||||
async function onSubmit() {
|
async function onSubmit() {
|
||||||
if (value.length === 0) {
|
if (value.length === 0) {
|
||||||
return toast.error("Error! Silahkan pilih admin divisi")
|
return toast.error("Error! Silakan pilih admin divisi")
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ export default function NavbarCreateUsers({ grup, onClose }: { grup?: string, on
|
|||||||
|
|
||||||
function onSubmit() {
|
function onSubmit() {
|
||||||
if (selectedFiles.length == 0) {
|
if (selectedFiles.length == 0) {
|
||||||
return toast.error("Error! silahkan pilih anggota")
|
return toast.error("Error! Silakan pilih anggota")
|
||||||
}
|
}
|
||||||
member.set(selectedFiles)
|
member.set(selectedFiles)
|
||||||
onClose(true)
|
onClose(true)
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ export default function AddFileDetailProject() {
|
|||||||
if (fileForm.length > 0) {
|
if (fileForm.length > 0) {
|
||||||
setOpenModal(true)
|
setOpenModal(true)
|
||||||
} else {
|
} else {
|
||||||
toast.error("Silahkan pilih file yang akan diupload")
|
toast.error("Silakan pilih file yang akan diupload")
|
||||||
}
|
}
|
||||||
}}>
|
}}>
|
||||||
Simpan
|
Simpan
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ export default function AddMemberDetailProject() {
|
|||||||
|
|
||||||
function onVerifikasi() {
|
function onVerifikasi() {
|
||||||
if (selectedFiles.length == 0) {
|
if (selectedFiles.length == 0) {
|
||||||
return toast.error("Error! silahkan pilih anggota")
|
return toast.error("Error! Silakan pilih anggota")
|
||||||
}
|
}
|
||||||
|
|
||||||
setOpenModal(true)
|
setOpenModal(true)
|
||||||
|
|||||||
@@ -142,10 +142,10 @@ export default function CreateProject() {
|
|||||||
return false
|
return false
|
||||||
|
|
||||||
if (dataTask.length == 0)
|
if (dataTask.length == 0)
|
||||||
return toast.error("Error! silahkan tambahkan tugas")
|
return toast.error("Error! Silakan tambahkan tugas")
|
||||||
|
|
||||||
if (memberValue.length <= 1)
|
if (memberValue.length <= 1)
|
||||||
return toast.error("Error! Silahkan pilih anggota lebih dari 1")
|
return toast.error("Error! Silakan pilih anggota lebih dari 1")
|
||||||
|
|
||||||
setModal(true)
|
setModal(true)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ export default function CreateUsersProject({ grup, onClose }: { grup?: string, o
|
|||||||
|
|
||||||
function onSubmit() {
|
function onSubmit() {
|
||||||
if (selectedFiles.length == 0) {
|
if (selectedFiles.length == 0) {
|
||||||
return toast.error("Error! silahkan pilih anggota")
|
return toast.error("Error! Silakan pilih anggota")
|
||||||
}
|
}
|
||||||
member.set(selectedFiles)
|
member.set(selectedFiles)
|
||||||
onClose(true)
|
onClose(true)
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ export default function AddFileDetailTask() {
|
|||||||
if (fileForm.length > 0) {
|
if (fileForm.length > 0) {
|
||||||
setOpenModal(true)
|
setOpenModal(true)
|
||||||
} else {
|
} else {
|
||||||
toast.error("Silahkan pilih file yang akan diupload")
|
toast.error("Silakan pilih file yang akan diupload")
|
||||||
}
|
}
|
||||||
}}>
|
}}>
|
||||||
Simpan
|
Simpan
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ export default function AddMemberDetailTask() {
|
|||||||
|
|
||||||
function onVerifikasi() {
|
function onVerifikasi() {
|
||||||
if (selectedFiles.length == 0) {
|
if (selectedFiles.length == 0) {
|
||||||
return toast.error("Error! silahkan pilih anggota")
|
return toast.error("Error! Silakan pilih anggota")
|
||||||
}
|
}
|
||||||
|
|
||||||
setOpenModal(true)
|
setOpenModal(true)
|
||||||
|
|||||||
@@ -105,10 +105,10 @@ export default function CreateTask() {
|
|||||||
return false
|
return false
|
||||||
|
|
||||||
if (dataTask.length == 0)
|
if (dataTask.length == 0)
|
||||||
return toast.error("Error! silahkan tambahkan tugas")
|
return toast.error("Error! Silakan tambahkan tugas")
|
||||||
|
|
||||||
if (memberValue.length <= 1)
|
if (memberValue.length <= 1)
|
||||||
return toast.error("Error! silahkan pilih anggota lebih dari 1")
|
return toast.error("Error! Silakan pilih anggota lebih dari 1")
|
||||||
|
|
||||||
setOpenModal(true)
|
setOpenModal(true)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ export default function CreateUsersProject({ onClose }: { onClose: (val: any) =>
|
|||||||
|
|
||||||
function onSubmit() {
|
function onSubmit() {
|
||||||
if (selectedFiles.length == 0) {
|
if (selectedFiles.length == 0) {
|
||||||
return toast.error("Error! silahkan pilih anggota")
|
return toast.error("Error! Silakan pilih anggota")
|
||||||
}
|
}
|
||||||
member.set(selectedFiles)
|
member.set(selectedFiles)
|
||||||
onClose(true)
|
onClose(true)
|
||||||
|
|||||||
Reference in New Issue
Block a user