fix: set send status on resend (#3011)

This commit is contained in:
David Nguyen
2026-06-22 17:00:24 +10:00
committed by GitHub
parent d9b7722325
commit 2f24a8eab2
2 changed files with 77 additions and 0 deletions
@@ -13,6 +13,7 @@ import {
EnvelopeType,
OrganisationType,
RecipientRole,
SendStatus,
SigningStatus,
WebhookTriggerEvents,
} from '@prisma/client';
@@ -276,6 +277,18 @@ export const resendDocument = async ({ id, userId, recipients, teamId, requestMe
}),
});
// Mark the recipient as sent if they were not already sent.
await prisma.recipient.updateMany({
where: {
id: recipient.id,
sendStatus: SendStatus.NOT_SENT,
},
data: {
sendStatus: SendStatus.SENT,
sentAt: new Date(),
},
});
await prisma.documentAuditLog.create({
data: createDocumentAuditLogData({
type: DOCUMENT_AUDIT_LOG_TYPE.EMAIL_SENT,