feat: add/update title of the document (#663)

This commit is contained in:
Tanay
2023-11-28 09:26:50 +05:30
committed by GitHub
parent 8048c29480
commit adc97802ea
9 changed files with 221 additions and 9 deletions

View File

@ -0,0 +1,21 @@
'use server';
import { prisma } from '@documenso/prisma';
export type UpdateTitleOptions = {
userId: number;
documentId: number;
title: string;
};
export const updateTitle = async ({ userId, documentId, title }: UpdateTitleOptions) => {
return await prisma.document.update({
where: {
id: documentId,
userId,
},
data: {
title,
},
});
};