fix: userId missing in aftersave of doucment and template cls

This commit is contained in:
prafull-opensignlabs
2024-01-16 18:09:10 +05:30
parent eefaf5fe50
commit a1a84b6928
3 changed files with 11 additions and 6 deletions
@@ -43,7 +43,7 @@ async function DocumentAftersave(request) {
if (signers && signers.length > 0) {
await updateAclDoc(request.object.id);
} else {
if (request?.object?.id) {
if (request?.object?.id && request.user) {
await updateSelfDoc(request.object.id);
}
}
@@ -8,7 +8,9 @@ export default async function TemplateAfterSave(request) {
if (signers && signers.length > 0) {
await updateAclDoc(request.object.id);
} else {
await updateSelfDoc(request.object.id);
if (request?.object?.id && request.user) {
await updateSelfDoc(request.object.id);
}
}
} else {
if (request.user) {
@@ -16,7 +18,9 @@ export default async function TemplateAfterSave(request) {
if (signers && signers.length > 0) {
await updateAclDoc(request.object.id);
} else {
await updateSelfDoc(request.object.id);
if (request?.object?.id) {
await updateSelfDoc(request.object.id);
}
}
}
}
@@ -66,7 +70,7 @@ export default async function TemplateAfterSave(request) {
async function updateSelfDoc(objId) {
// console.log("Inside updateSelfDoc func")
const Query = new Parse.Query('contracts_Template');
const updateACL = await Query.get(objId, { useMasterKey: true });
// const res = JSON.parse(JSON.stringify(updateACL));