mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 00:03:33 +10:00
@ -33,8 +33,10 @@ export const createEnvelopeRoute = authenticatedProcedure
|
||||
},
|
||||
});
|
||||
|
||||
// Todo: Envelopes - Put the claims for number of items into this.
|
||||
const { remaining } = await getServerLimits({ userId: user.id, teamId });
|
||||
const { remaining, maximumEnvelopeItemCount } = await getServerLimits({
|
||||
userId: user.id,
|
||||
teamId,
|
||||
});
|
||||
|
||||
if (remaining.documents <= 0) {
|
||||
throw new AppError(AppErrorCode.LIMIT_EXCEEDED, {
|
||||
@ -43,6 +45,13 @@ export const createEnvelopeRoute = authenticatedProcedure
|
||||
});
|
||||
}
|
||||
|
||||
if (items.length > maximumEnvelopeItemCount) {
|
||||
throw new AppError('ENVELOPE_ITEM_LIMIT_EXCEEDED', {
|
||||
message: `You cannot upload more than ${maximumEnvelopeItemCount} envelope items per envelope`,
|
||||
statusCode: 400,
|
||||
});
|
||||
}
|
||||
|
||||
const envelope = await createEnvelope({
|
||||
userId: user.id,
|
||||
teamId,
|
||||
|
||||
Reference in New Issue
Block a user