refactor: changes in cloud function

This commit is contained in:
prafull-opensignlabs
2024-07-25 20:34:44 +05:30
parent e5f1524b10
commit 44754095fb
5 changed files with 67 additions and 1 deletions
@@ -48,6 +48,15 @@ export default async function addOrganization(request) {
objectId: resExt.id,
});
const newResOrg = await newOrg.save(null, { useMasterKey: true });
const teamCls = new Parse.Object('contracts_Teams');
teamCls.set('Name', 'All Users');
teamCls.set('OrganizationId', {
__type: 'Pointer',
className: 'contracts_Organizations',
objectId: newResOrg.id,
});
teamCls.set('IsActive', true);
await teamCls.save(null, { useMasterKey: true });
if (newResOrg) {
return newResOrg;
}