fix: create contact not working and handle err

This commit is contained in:
prafull-opensignlabs
2024-01-17 16:33:59 +05:30
parent a1a84b6928
commit 83df89c115
13 changed files with 44 additions and 41 deletions
@@ -3,13 +3,13 @@ async function ContactbookAftersave(request) {
you can check as follows */
if (!request.original) {
const user = request.user;
const object = request.object;
// Retrieve the current ACL
const acl = new Parse.ACL();
// Ensure the current user has read access
if (acl) {
if (acl && request?.user) {
const object = request.object;
acl.setReadAccess(user, true);
acl.setWriteAccess(user, true);
acl.setReadAccess(object.get('UserId'), true);