mirror of
https://github.com/documenso/documenso.git
synced 2025-11-22 12:41:36 +10:00
getDocument recfactor, qoc
This commit is contained in:
@ -19,10 +19,7 @@ async function getHandler(req: NextApiRequest, res: NextApiResponse) {
|
||||
return;
|
||||
}
|
||||
|
||||
const document: PrismaDocument = await getDocument(+documentId, {
|
||||
res: res,
|
||||
req: req,
|
||||
});
|
||||
const document: PrismaDocument = await getDocument(+documentId, req, res);
|
||||
|
||||
if (!document)
|
||||
res.status(404).end(`No document with id ${documentId} found.`);
|
||||
|
||||
@ -21,10 +21,7 @@ async function postHandler(req: NextApiRequest, res: NextApiResponse) {
|
||||
return;
|
||||
}
|
||||
|
||||
const document: PrismaDocument = await getDocument(+documentId, {
|
||||
res: res,
|
||||
req: req,
|
||||
});
|
||||
const document: PrismaDocument = await getDocument(+documentId, req, res);
|
||||
|
||||
// todo encapsulate entity ownerships
|
||||
if (document.userId !== user.id) {
|
||||
|
||||
@ -20,10 +20,7 @@ async function postHandler(req: NextApiRequest, res: NextApiResponse) {
|
||||
return;
|
||||
}
|
||||
|
||||
const document: PrismaDocument = await getDocument(+documentId, {
|
||||
res: res,
|
||||
req: req,
|
||||
});
|
||||
const document: PrismaDocument = await getDocument(+documentId, req, res);
|
||||
|
||||
if (!document)
|
||||
res.status(404).end(`No document with id ${documentId} found.`);
|
||||
|
||||
@ -27,10 +27,11 @@ async function postHandler(req: NextApiRequest, res: NextApiResponse) {
|
||||
return;
|
||||
}
|
||||
|
||||
const document: PrismaDocument = await getDocument(recipient.documentId, {
|
||||
res: res,
|
||||
req: req,
|
||||
});
|
||||
const document: PrismaDocument = await getDocument(
|
||||
recipient.documentId,
|
||||
res,
|
||||
req
|
||||
);
|
||||
|
||||
if (!document) res.status(404).end(`No document found.`);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user