mirror of
https://github.com/OpenSignLabs/OpenSign.git
synced 2026-08-20 06:35:54 +02:00
fix: team list is not visible and change teams class
This commit is contained in:
@@ -28,19 +28,17 @@ export default async function getReport(request) {
|
||||
if (reportId == '6TeaPr321t') {
|
||||
const extUserQuery = new Parse.Query('contracts_Users');
|
||||
extUserQuery.equalTo('Email', userRes.data.email);
|
||||
extUserQuery.include('DepartmentIds');
|
||||
extUserQuery.include('TeamIds');
|
||||
const extUser = await extUserQuery.first({ useMasterKey: true });
|
||||
if (extUser) {
|
||||
const _extUser = JSON.parse(JSON.stringify(extUser));
|
||||
if (_extUser?.DepartmentIds && _extUser.DepartmentIds?.length > 0) {
|
||||
let departmentArr = [];
|
||||
_extUser?.DepartmentIds?.forEach(
|
||||
x => (departmentArr = [...departmentArr, ...x.Ancestors])
|
||||
);
|
||||
if (_extUser?.TeamIds && _extUser.TeamIds?.length > 0) {
|
||||
let teamArr = [];
|
||||
_extUser?.TeamIds?.forEach(x => (teamArr = [...teamArr, ...x.Ancestors]));
|
||||
strParams = JSON.stringify({
|
||||
...params,
|
||||
$or: [
|
||||
{ SharedWith: { $in: departmentArr } },
|
||||
{ SharedWith: { $in: teamArr } },
|
||||
{
|
||||
ExtUserPtr: {
|
||||
__type: 'Pointer',
|
||||
|
||||
Reference in New Issue
Block a user