feat: document authoring

This commit is contained in:
Mythie
2023-08-17 19:56:18 +10:00
parent c6327c77ea
commit 7a705e3b81
50 changed files with 2037 additions and 93 deletions

View File

@ -0,0 +1,30 @@
import { prisma } from '@documenso/prisma';
export interface GetDocumentAndSenderByTokenOptions {
token: string;
}
export const getDocumentAndSenderByToken = async ({
token,
}: GetDocumentAndSenderByTokenOptions) => {
const result = await prisma.document.findFirstOrThrow({
where: {
Recipient: {
some: {
token,
},
},
},
include: {
User: true,
},
});
// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
const { password: _password, ...User } = result.User;
return {
...result,
User,
};
};