mirror of
https://github.com/documenso/documenso.git
synced 2025-11-12 15:53:02 +10:00
22 lines
383 B
TypeScript
22 lines
383 B
TypeScript
'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,
|
|
},
|
|
});
|
|
};
|