mirror of
https://github.com/documenso/documenso.git
synced 2025-11-17 02:01:33 +10:00
fix: soft delete a document when the owner deletes it
This commit is contained in:
committed by
Mythie
parent
26ccdc1b23
commit
2837b178fb
@ -138,6 +138,16 @@ const handleDocumentOwnerDelete = async ({
|
||||
}),
|
||||
});
|
||||
|
||||
// Soft delete for document recipients since the owner is deleting it
|
||||
await tx.recipient.updateMany({
|
||||
where: {
|
||||
documentId: document.id,
|
||||
},
|
||||
data: {
|
||||
documentDeletedAt: new Date().toISOString(),
|
||||
},
|
||||
});
|
||||
|
||||
return await tx.document.update({
|
||||
where: {
|
||||
id: document.id,
|
||||
|
||||
Reference in New Issue
Block a user