Perbaikan get notif donasi
This commit is contained in:
@@ -9,9 +9,9 @@ export default async function Layout({
|
|||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
}) {
|
}) {
|
||||||
const userId = await User_getUserId();
|
const userId = await User_getUserId();
|
||||||
// const dataDonasi = await DOnasi_getList
|
// console.log(userId)
|
||||||
const isRead = await Donasi_getNotifByUserId(userId).then((res) =>
|
const isRead = await Donasi_getNotifByUserId(userId).then((res: any) =>
|
||||||
res.map((val: any) => val.isRead)
|
res.map((val: any) => val.isRead)
|
||||||
);
|
);
|
||||||
// console.log(isRead)
|
// console.log(isRead)
|
||||||
|
|
||||||
|
|||||||
@@ -3,12 +3,6 @@
|
|||||||
import prisma from "@/app/lib/prisma";
|
import prisma from "@/app/lib/prisma";
|
||||||
|
|
||||||
export async function Donasi_getNotifByUserId(userId: string) {
|
export async function Donasi_getNotifByUserId(userId: string) {
|
||||||
const dataInvoice = await prisma.donasi_Invoice.findFirst({
|
|
||||||
where: {
|
|
||||||
authorId: userId
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
// console.log(dataInvoice)
|
// console.log(dataInvoice)
|
||||||
|
|
||||||
// return null
|
// return null
|
||||||
@@ -22,10 +16,10 @@ export async function Donasi_getNotifByUserId(userId: string) {
|
|||||||
select: {
|
select: {
|
||||||
id: true,
|
id: true,
|
||||||
isRead: true,
|
isRead: true,
|
||||||
active: true,
|
// active: true,
|
||||||
createdAt: true,
|
// createdAt: true,
|
||||||
donasi_KabarId: true,
|
// donasi_KabarId: true,
|
||||||
Donasi_Kabar: true,
|
// Donasi_Kabar: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
return dataNotif;
|
return dataNotif;
|
||||||
|
|||||||
Reference in New Issue
Block a user