From f0655893ebfa6d42f3607eb7e7f2ef303a2305b6 Mon Sep 17 00:00:00 2001 From: prafull-opensignlabs Date: Mon, 5 Feb 2024 11:23:47 +0530 Subject: [PATCH] change response of createdocument API --- .../v1/routes/createDocumentwithCoordinate.js | 21 +++++++------------ 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/apps/OpenSignServer/cloud/customRoute/v1/routes/createDocumentwithCoordinate.js b/apps/OpenSignServer/cloud/customRoute/v1/routes/createDocumentwithCoordinate.js index aa4f475f4..e651a3a92 100644 --- a/apps/OpenSignServer/cloud/customRoute/v1/routes/createDocumentwithCoordinate.js +++ b/apps/OpenSignServer/cloud/customRoute/v1/routes/createDocumentwithCoordinate.js @@ -233,19 +233,14 @@ export default async function createDocumentwithCoordinate(request, response) { } if (sendMail.data.result.status === 'success') { - const user = contact.find(x => x.email === parseExtUser.Email); - if (user && user.email) { - return response.json({ - objectId: res.id, - url: `${baseUrl.origin}/loadmf/signmicroapp/login/${res.id}/${user.email}/${user.contactPtr.objectId}/${serverParams}`, - message: 'Document sent successfully!', - }); - } else { - return response.json({ - objectId: res.id, - message: 'Document sent successfully!', - }); - } + return response.json({ + objectId: res.id, + signurl: contact.map(x => ({ + email: x.email, + url: `${baseUrl.origin}/loadmf/signmicroapp/login/${res.id}/${x.email}/${x.contactPtr.objectId}/${serverParams}`, + })), + message: 'Document sent successfully!', + }); } } else { return response.status(400).json({ error: 'Please provide signers!' });