mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 08:13:56 +10:00
feat: add inbox
This commit is contained in:
24
apps/web/src/components/(dashboard)/inbox/inbox.actions.ts
Normal file
24
apps/web/src/components/(dashboard)/inbox/inbox.actions.ts
Normal 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',
|
||||
},
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user