feat: persist document metadata in database for a specific user

This commit is contained in:
Ephraim Atta-Duncan
2023-09-20 09:51:04 +00:00
parent 6860726e83
commit d5238939ad
4 changed files with 85 additions and 7 deletions

View File

@ -0,0 +1,21 @@
'use server';
import { Prisma } from '@prisma/client';
import { prisma } from '@documenso/prisma';
export type UpdateDocumentOptions = {
documentId: number;
data: Prisma.DocumentUpdateInput;
};
export const updateDocument = async ({ documentId, data }: UpdateDocumentOptions) => {
return await prisma.document.update({
where: {
id: documentId,
},
data: {
...data,
},
});
};