Skip to content

Commit

Permalink
exapanging mail service
Browse files Browse the repository at this point in the history
  • Loading branch information
ehsan-g committed Nov 10, 2023
1 parent a68d990 commit 9abe91c
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/features/children/children.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,9 @@ export class ChildrenController {
}
let ngoIds: number[];
let swIds: number[];

const socialWorker = await this.userService.getFlaskSocialWorker(
panelFlaskUserId,
);
if (convertFlaskToSayRoles(panelFlaskTypeId) === SAYPlatformRoles.AUDITOR) {
// for auditor - admin
swIds = await this.userService
Expand All @@ -543,14 +545,11 @@ export class ChildrenController {
SAYPlatformRoles.NGO_SUPERVISOR
) {
// for ngo supervisor
const supervisor = await this.userService.getFlaskSocialWorker(
panelFlaskUserId,
);

swIds = await this.userService
.getFlaskSocialWorkersByNgo(supervisor.ngo_id)
.getFlaskSocialWorkersByNgo(socialWorker.ngo_id)
.then((r) => r.map((s) => s.id));
ngoIds = [supervisor.ngo_id];
ngoIds = [socialWorker.ngo_id];
}

if (
Expand All @@ -575,7 +574,7 @@ export class ChildrenController {
path: '/',
},
status,
ngoIds,
ngoIds ? ngoIds : [socialWorker.ngo_id],
panelFlaskTypeId === FlaskUserTypesEnum.SOCIAL_WORKER
? [panelFlaskUserId]
: swIds,
Expand Down

0 comments on commit 9abe91c

Please sign in to comment.