mirror of
https://github.com/documenso/documenso.git
synced 2026-08-23 23:02:22 +10:00
feat: scope assistants to strictly later signing steps
This commit is contained in:
@@ -23,9 +23,13 @@ export const getRecipientsForAssistant = async ({ token }: GetRecipientsForAssis
|
||||
let recipients = await prisma.recipient.findMany({
|
||||
where: {
|
||||
envelopeId: assistant.envelopeId,
|
||||
signingOrder: {
|
||||
gte: assistant.signingOrder ?? 0,
|
||||
},
|
||||
OR: [
|
||||
// The assistant themself — they may have fields of their own.
|
||||
{ id: assistant.id },
|
||||
// Grouped assistants only assist strictly later steps, never their
|
||||
// own group peers.
|
||||
{ signingOrder: { gt: assistant.signingOrder ?? 0 } },
|
||||
],
|
||||
},
|
||||
include: {
|
||||
fields: {
|
||||
|
||||
Reference in New Issue
Block a user