컴잇
Some checks failed
deploy-on-main / deploy (push) Failing after 23s

This commit is contained in:
koreacomp5
2025-11-10 01:39:44 +09:00
parent 4337a8f69a
commit b579b32138
25 changed files with 361 additions and 70 deletions

View File

@@ -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" },