fix: x is not defined error in createDocumentWithTemplate and createDocumentwithCoordinate function

This commit is contained in:
RaktimaNXG
2024-05-07 19:29:09 +05:30
parent 0f67013005
commit a26e65f76f
2 changed files with 4 additions and 6 deletions
@@ -317,13 +317,13 @@ export default async function createDocumentWithTemplate(request, response) {
properties: { response_code: 200 },
});
}
//encode this url value `${res.id}/${x.email}/${x.contactPtr.objectId}` to base64 using `btoa` function
const encodeBase64 = btoa(`${res.id}/${x.email}/${x.contactPtr.objectId}`);
return response.json({
objectId: res.id,
signurl: contact.map(x => ({
email: x.email,
url: `${baseUrl.origin}/login/${encodeBase64}`,
url: `${baseUrl.origin}/login/${btoa(
`${res.id}/${x.email}/${x.contactPtr.objectId}`
)}`,
})),
message: 'Document sent successfully!',
});
@@ -361,13 +361,11 @@ export default async function createDocumentwithCoordinate(request, response) {
properties: { response_code: 200 },
});
}
//encode this url value `${res.id}/${x.email}/${x.contactPtr.objectId}` to base64 using `btoa` function
const encodeBase64 = btoa(`${res.id}/${x.email}/${x.contactPtr.objectId}`);
return response.json({
objectId: res.id,
signurl: contact.map(x => ({
email: x.email,
url: `${baseUrl.origin}/login/${encodeBase64}`,
url: `${baseUrl.origin}/login/${btoa(`${res.id}/${x.email}/${x.contactPtr.objectId}`)}`,
})),
message: 'Document sent successfully!',
});