mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 16:23:06 +10:00
fix: minor updates
This commit is contained in:
@ -213,11 +213,11 @@ export const sendDocument = async ({
|
|||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
const allRecipientsAreCC = document.Recipient.every(
|
const allRecipientsHaveNoActionToTake = document.Recipient.every(
|
||||||
(recipient) => recipient.role === RecipientRole.CC,
|
(recipient) => recipient.role === RecipientRole.CC,
|
||||||
);
|
);
|
||||||
|
|
||||||
if (allRecipientsAreCC) {
|
if (allRecipientsHaveNoActionToTake) {
|
||||||
const updatedDocument = await updateDocument({
|
const updatedDocument = await updateDocument({
|
||||||
documentId,
|
documentId,
|
||||||
userId,
|
userId,
|
||||||
@ -225,7 +225,17 @@ export const sendDocument = async ({
|
|||||||
data: { status: DocumentStatus.COMPLETED },
|
data: { status: DocumentStatus.COMPLETED },
|
||||||
});
|
});
|
||||||
|
|
||||||
return await sealDocument({ documentId: updatedDocument.id, requestMetadata });
|
await sealDocument({ documentId: updatedDocument.id, requestMetadata });
|
||||||
|
|
||||||
|
// Keep the return type the same for the `sendDocument` method
|
||||||
|
return await prisma.document.findFirstOrThrow({
|
||||||
|
where: {
|
||||||
|
id: documentId,
|
||||||
|
},
|
||||||
|
include: {
|
||||||
|
Recipient: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const updatedDocument = await prisma.$transaction(async (tx) => {
|
const updatedDocument = await prisma.$transaction(async (tx) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user