extend expire date of expired draft document

This commit is contained in:
RaktimaNXG
2024-01-10 15:11:26 +05:30
parent 9cb0ced4f6
commit 148ae40e1a
4 changed files with 56 additions and 105 deletions
@@ -639,6 +639,7 @@ function PlaceHolderSign() {
setIsSendAlert(alert);
}
};
const sendEmailToSigners = async () => {
const loadObj = {
isLoad: true,
@@ -723,12 +724,32 @@ function PlaceHolderSign() {
const currentUser = signersdata.find((x) => x.Email === currentId);
setCurrentId(currentUser?.objectId);
const expiryTime = new Date(expireDate).getTime();
const currDate = new Date().getTime();
let updateExpiryDate, data;
if (currDate > expiryTime) {
updateExpiryDate = new Date(expireDate);
updateExpiryDate.setDate(updateExpiryDate.getDate() + 15);
}
try {
const data = {
Placeholders: signerPos,
SignedUrl: pdfDetails[0].URL,
Signers: signers
};
if (updateExpiryDate) {
data = {
Placeholders: signerPos,
SignedUrl: pdfDetails[0].URL,
Signers: signers,
ExpiryDate: {
iso: updateExpiryDate,
__type: "Date"
}
};
} else {
data = {
Placeholders: signerPos,
SignedUrl: pdfDetails[0].URL,
Signers: signers
};
}
await axios
.put(