mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 22:00:31 +00:00
refactor: payment services to nestjs
This commit is contained in:
@@ -15,9 +15,12 @@ import {
|
||||
import { Request, Response, NextFunction } from 'express';
|
||||
import { ApiTags } from '@nestjs/swagger';
|
||||
import { PaymentServicesApplication } from './PaymentServicesApplication';
|
||||
import { PublicRoute } from '../Auth/Jwt.guard';
|
||||
import { EditPaymentMethodDTO } from './types';
|
||||
|
||||
@ApiTags('PaymentServices')
|
||||
@Controller('payment-services')
|
||||
@PublicRoute()
|
||||
export class PaymentServicesController {
|
||||
constructor(
|
||||
private readonly paymentServicesApp: PaymentServicesApplication,
|
||||
@@ -53,13 +56,10 @@ export class PaymentServicesController {
|
||||
}
|
||||
|
||||
@Post('/:paymentMethodId')
|
||||
@UsePipes(new ValidationPipe({ whitelist: true }))
|
||||
async updatePaymentMethod(
|
||||
@Param('paymentMethodId') paymentMethodId: number,
|
||||
@Body() updatePaymentMethodDTO: any,
|
||||
@Req() req: Request,
|
||||
@Body() updatePaymentMethodDTO: EditPaymentMethodDTO,
|
||||
@Res() res: Response,
|
||||
@Next() next: NextFunction,
|
||||
) {
|
||||
await this.paymentServicesApp.editPaymentMethod(
|
||||
paymentMethodId,
|
||||
|
||||
Reference in New Issue
Block a user