feat: bulk send is working for exist contact

This commit is contained in:
prafull-opensignlabs
2024-05-22 19:31:32 +05:30
parent ffc8e4b23e
commit 7e4f12e41a
3 changed files with 89 additions and 45 deletions
+2 -2
View File
@@ -118,8 +118,8 @@ const BulkSendUi = (props) => {
// Push a new document object with updated Placeholders into the Documents array
Documents.push({ ...props.item, Placeholders: updatedPlaceholders });
});
console.log("Documents ", Documents);
// await batchQuery(Documents);
// console.log("Documents ", Documents);
await batchQuery(Documents);
};
const batchQuery = async (Documents) => {
@@ -632,11 +632,27 @@ const ReportTable = (props) => {
}
};
const handleBulkSend = (template) => {
if (template?.Placeholders?.length > 0) {
setPlaceholders(template?.Placeholders);
setTemplateDetails(template);
setIsBulkSend({ [template.objectId]: true });
const handleBulkSend = async (template) => {
const params = {
templateId: template.objectId,
include: ["Placeholders.signerPtr"]
};
const axiosRes = await axios.post(
`${localStorage.getItem("baseUrl")}functions/getTemplate`,
params,
{
headers: {
"Content-Type": "application/json",
"X-Parse-Application-Id": localStorage.getItem("parseAppId"),
sessionToken: localStorage.getItem("accesstoken")
}
}
);
const templateRes = axiosRes.data && axiosRes.data.result;
if (templateRes?.Placeholders?.length > 0) {
setPlaceholders(templateRes?.Placeholders);
setTemplateDetails(templateRes);
setIsBulkSend({ [templateRes.objectId]: true });
} else {
setIsDocErr(true);
}