mirror of
https://github.com/documenso/documenso.git
synced 2025-11-12 15:53:02 +10:00
fix: improve document meta logic
This commit is contained in:
@ -8,6 +8,7 @@ export type CreateDocumentMetaOptions = {
|
||||
message: string;
|
||||
timezone: string;
|
||||
dateFormat: string;
|
||||
userId: number;
|
||||
};
|
||||
|
||||
export const upsertDocumentMeta = async ({
|
||||
@ -16,7 +17,15 @@ export const upsertDocumentMeta = async ({
|
||||
timezone,
|
||||
dateFormat,
|
||||
documentId,
|
||||
userId,
|
||||
}: CreateDocumentMetaOptions) => {
|
||||
await prisma.document.findFirstOrThrow({
|
||||
where: {
|
||||
id: documentId,
|
||||
userId,
|
||||
},
|
||||
});
|
||||
|
||||
return await prisma.documentMeta.upsert({
|
||||
where: {
|
||||
documentId,
|
||||
|
||||
Reference in New Issue
Block a user