fix: await signing requests

This commit is contained in:
Mythie
2023-07-08 18:52:13 +10:00
parent 5922725e1a
commit 6c78332258

View File

@ -48,11 +48,14 @@ async function postHandler(req: NextApiRequest, res: NextApiResponse) {
}
let sentRequests = 0;
recipients.forEach(async (recipient) => {
await sendSigningRequest(recipient, document, user);
sentRequests++;
});
await Promise.all(
recipients.map(async (recipient) => {
await sendSigningRequest(recipient, document, user);
sentRequests++;
})
);
if (sentRequests === recipients.length) {
return res.status(200).send(recipients.length);