From 31422db25d2a650d5cd1860925803cdabcdcb744 Mon Sep 17 00:00:00 2001 From: Bagasbanuna02 Date: Mon, 22 Jan 2024 11:02:58 +0800 Subject: [PATCH] Perbaikan get notif donasi --- src/app/dev/donasi/main/layout.tsx | 6 +++--- .../donasi/fun/get/get_notif_by_user_id.ts | 14 ++++---------- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/src/app/dev/donasi/main/layout.tsx b/src/app/dev/donasi/main/layout.tsx index 3b3c15bf..36134c44 100644 --- a/src/app/dev/donasi/main/layout.tsx +++ b/src/app/dev/donasi/main/layout.tsx @@ -9,9 +9,9 @@ export default async function Layout({ children: React.ReactNode; }) { const userId = await User_getUserId(); - // const dataDonasi = await DOnasi_getList - const isRead = await Donasi_getNotifByUserId(userId).then((res) => - res.map((val: any) => val.isRead) + // console.log(userId) + const isRead = await Donasi_getNotifByUserId(userId).then((res: any) => + res.map((val: any) => val.isRead) ); // console.log(isRead) diff --git a/src/app_modules/donasi/fun/get/get_notif_by_user_id.ts b/src/app_modules/donasi/fun/get/get_notif_by_user_id.ts index 75411f84..f7c05c8e 100644 --- a/src/app_modules/donasi/fun/get/get_notif_by_user_id.ts +++ b/src/app_modules/donasi/fun/get/get_notif_by_user_id.ts @@ -3,12 +3,6 @@ import prisma from "@/app/lib/prisma"; export async function Donasi_getNotifByUserId(userId: string) { - const dataInvoice = await prisma.donasi_Invoice.findFirst({ - where: { - authorId: userId - } - }) - // console.log(dataInvoice) // return null @@ -22,10 +16,10 @@ export async function Donasi_getNotifByUserId(userId: string) { select: { id: true, isRead: true, - active: true, - createdAt: true, - donasi_KabarId: true, - Donasi_Kabar: true, + // active: true, + // createdAt: true, + // donasi_KabarId: true, + // Donasi_Kabar: true, }, }); return dataNotif;