Merge pull request #675 from OpenSignLabs/staging

v2.22.0
This commit is contained in:
prafull-opensignlabs
2025-05-27 12:28:40 +00:00
parent 1550e3a3d0
commit 98754c776f
42 changed files with 8999 additions and 21535 deletions
@@ -36,17 +36,24 @@ export default async function GetTemplate(request) {
let teamsArr = [];
_extUser?.TeamIds?.forEach(x => (teamsArr = [...teamsArr, ...x.Ancestors]));
// Create the first query
const sharedWithQuery = new Parse.Query('contracts_Template');
sharedWithQuery.containedIn('SharedWith', teamsArr);
const sharedWithTeamQuery = new Parse.Query('contracts_Template');
sharedWithTeamQuery.containedIn('SharedWith', teamsArr);
// Create the second query
const sharedWithJsersQuery = new Parse.Query('contracts_Template');
sharedWithJsersQuery.equalTo('SharedWithUsers', {
__type: 'Pointer',
className: 'contracts_Users',
objectId: extUser.id,
});
// Create the third query
const createdByQuery = new Parse.Query('contracts_Template');
createdByQuery.equalTo('ExtUserPtr', {
__type: 'Pointer',
className: 'contracts_Users',
objectId: extUser.id,
});
template = Parse.Query.or(sharedWithQuery, createdByQuery);
template = Parse.Query.or(sharedWithTeamQuery, sharedWithJsersQuery, createdByQuery);
template.equalTo('objectId', templateId);
template.notEqualTo('IsArchive', true);
template.include('ExtUserPtr');