Skip to content

Commit

Permalink
modifying paymntapi
Browse files Browse the repository at this point in the history
  • Loading branch information
ehsan-g committed Aug 14, 2024
1 parent dee1929 commit ddad33d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/features/payment/payment.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,20 @@ import { FlaskUserTypesEnum } from 'src/types/interfaces/interface';
export class PaymentController {
constructor(private paymentService: PaymentService) { }

@Get(`new`)
@ApiOperation({ description: 'Get all needs payments' })
async newPayments(@Req() req: Request) {
const panelFlaskUserId = req.headers['panelFlaskUserId'];
const panelFlaskTypeId = req.headers['panelFlaskTypeId'];
if (
!isAuthenticated(panelFlaskUserId, panelFlaskTypeId) ||
panelFlaskTypeId !== FlaskUserTypesEnum.SUPER_ADMIN
) {
throw new ForbiddenException('You Are not the Super admin');
}
return await this.paymentService.getPayments();
}

@Get(`all`)
@ApiOperation({ description: 'Get all needs payments' })
async getPayments(@Req() req: Request) {
Expand Down

0 comments on commit ddad33d

Please sign in to comment.