feat: add user from, show deparments, users in pages

This commit is contained in:
prafull-opensignlabs
2024-06-28 12:48:50 +05:30
parent 70a3adebd7
commit 7b2b71fea5
7 changed files with 520 additions and 58 deletions
@@ -1,4 +1,4 @@
export default async function getUserByOrgId(req) {
export default async function getUserByOrg(req) {
const OrganizationId = req.params.organizationId;
const orgPtr = {
__type: 'Pointer',
@@ -10,6 +10,7 @@ export default async function getUserByOrgId(req) {
} else {
try {
const extUser = new Parse.Query('contracts_Users');
extUser.include('DepartmentIds');
extUser.equalTo('OrganizationId', orgPtr);
const userRes = await extUser.first({ useMasterKey: true });
if (userRes.length > 0) {
@@ -1,4 +1,4 @@
export default async function getUserList(req) {
export default async function getUserListByOrg(req) {
const OrganizationId = req.params.organizationId;
const orgPtr = {
__type: 'Pointer',
@@ -11,6 +11,7 @@ export default async function getUserList(req) {
try {
const extUser = new Parse.Query('contracts_Users');
extUser.equalTo('OrganizationId', orgPtr);
extUser.include('DepartmentIds');
const userRes = await extUser.find({ useMasterKey: true });
if (userRes.length > 0) {
const _userRes = JSON.parse(JSON.stringify(userRes));