This commit is contained in:
Timur Ercan
2023-02-18 13:19:37 +01:00
parent 2934cf3615
commit 15cd0d2a7b

View File

@ -36,17 +36,14 @@ async function postHandler(req: NextApiRequest, res: NextApiResponse) {
if (!recipients.length) return res.status(200).end(""); if (!recipients.length) return res.status(200).end("");
(await recipients).forEach(async (recipient) => { recipients.forEach(async (recipient) => {
await sendSigningRequest(recipient, document, user) await sendSigningRequest(recipient, document, user).catch((err) => {
.then(() => { console.log(err);
return res.status(200).end(); return res.status(502).end("Coud not send request for signing.");
}) });
.catch((err) => {
console.log(err);
return res.status(502).end("Coud not send request for signing.");
});
}); });
return res.status(202).end();
// todo check if recipient has an account and show them in their inbox or something // todo check if recipient has an account and show them in their inbox or something
} }