refactor: improve find envelopes endpoint implementation

This commit is contained in:
Ephraim Atta-Duncan
2025-11-25 21:13:01 +00:00
parent 4d29a66ba1
commit c5b7522ea0
4 changed files with 47 additions and 30 deletions

View File

@@ -150,18 +150,6 @@ export const findEnvelopes = async ({
[orderByColumn]: orderByDirection,
},
include: {
envelopeItems: {
select: {
envelopeId: true,
id: true,
title: true,
order: true,
},
orderBy: {
order: 'asc',
},
},
documentMeta: true,
user: {
select: {
id: true,
@@ -174,21 +162,12 @@ export const findEnvelopes = async ({
id: 'asc',
},
},
fields: true,
team: {
select: {
id: true,
url: true,
},
},
directLink: {
select: {
directTemplateRecipientId: true,
enabled: true,
id: true,
token: true,
},
},
},
}),
prisma.envelope.count({