Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ehsan-g committed Sep 12, 2023
1 parent 928b54f commit c62dd4e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 2 additions & 5 deletions src/features/analytic/analytic.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
FlaskUserTypesEnum,
NeedTypeEnum,
SAYPlatformRoles,
SUPER_ADMIN_ID,
} from 'src/types/interfaces/interface';
import { convertFlaskToSayRoles } from 'src/utils/helpers';
import { UserService } from '../user/user.service';
Expand Down Expand Up @@ -192,10 +191,8 @@ export class AnalyticController {
async getUserContribution(@Req() req: Request) {
const panelFlaskUserId = req.headers['panelFlaskUserId'];
const panelFlaskTypeId = req.headers['panelFlaskTypeId'];
if (
!isAuthenticated(panelFlaskUserId, panelFlaskTypeId) ||
panelFlaskTypeId !== FlaskUserTypesEnum.SUPER_ADMIN
) {

if (!isAuthenticated(panelFlaskUserId, panelFlaskTypeId)) {
throw new ForbiddenException(403, 'You Are not the Super admin');
}
const role = convertFlaskToSayRoles(Number(panelFlaskTypeId));
Expand Down
4 changes: 3 additions & 1 deletion src/features/wallet/wallet.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export class WalletService {
purchaser: need.purchaser.flaskUserId,
familyMembers: need.verifiedPayments.map((p) => p.flaskUserId),
};
let role;
let role: string;
const allRoles = [];

// could have multiple roles e.g. [Auditor, SocialWorker]
Expand All @@ -192,6 +192,8 @@ export class WalletService {
role = getSAYRolePersian(SAYPlatformRoles.FAMILY).toString();
allRoles.push(SAYPlatformRoles.FAMILY);
}
console.log(need);

if (!role) {
throw new WalletExceptionFilter(
403,
Expand Down

0 comments on commit c62dd4e

Please sign in to comment.