feat: add inbox

This commit is contained in:
David Nguyen
2023-08-07 23:10:27 +10:00
committed by Mythie
parent 6959307f5e
commit a99efdc916
22 changed files with 966 additions and 177 deletions

View File

@ -0,0 +1,24 @@
'use server';
import { z } from 'zod';
import { getRequiredServerComponentSession } from '@documenso/lib/next-auth/get-server-session';
import { prisma } from '@documenso/prisma';
export async function updateRecipientReadStatus(recipientId: number, documentId: number) {
z.number().parse(recipientId);
z.number().parse(documentId);
const { email } = await getRequiredServerComponentSession();
await prisma.recipient.update({
where: {
id: recipientId,
documentId,
email,
},
data: {
readStatus: 'OPENED',
},
});
}