@@ -276,6 +276,11 @@ export default async function MyPage({ searchParams }: { searchParams: Promise<{
|
||||
})()}
|
||||
{activeTab === "messages-received" && (async () => {
|
||||
const pageSize = 20;
|
||||
// 받은 쪽지함 진입 시 미읽은 메시지를 읽음 처리
|
||||
await prisma.message.updateMany({
|
||||
where: { receiverId: currentUser.userId, readAt: null },
|
||||
data: { readAt: new Date() },
|
||||
});
|
||||
const messages = await prisma.message.findMany({
|
||||
where: { receiverId: currentUser.userId },
|
||||
orderBy: { createdAt: "desc" },
|
||||
|
||||
Reference in New Issue
Block a user