- handle when product is not active cannot hit api transaction order prod
This commit is contained in:
		@@ -456,6 +456,21 @@ export class TransactionService {
 | 
			
		||||
    orderTransactionDto: OrderTransactionDto,
 | 
			
		||||
    currentUser: any,
 | 
			
		||||
  ) {
 | 
			
		||||
 | 
			
		||||
    const productData = await this.productService.findOne(
 | 
			
		||||
        orderTransactionDto.productCode,
 | 
			
		||||
        'prepaid',
 | 
			
		||||
    );
 | 
			
		||||
 | 
			
		||||
    if (productData.status == 'NOT ACTIVE') {
 | 
			
		||||
      throw new HttpException(
 | 
			
		||||
          {
 | 
			
		||||
            statusCode: HttpStatus.INTERNAL_SERVER_ERROR,
 | 
			
		||||
            error: `Transaction Failed because product is not active`,
 | 
			
		||||
          },
 | 
			
		||||
          HttpStatus.INTERNAL_SERVER_ERROR,
 | 
			
		||||
      );
 | 
			
		||||
    } else {
 | 
			
		||||
    let status;
 | 
			
		||||
    const amount = 0;
 | 
			
		||||
    //GET USER DATA
 | 
			
		||||
@@ -669,6 +684,7 @@ export class TransactionService {
 | 
			
		||||
      status: status,
 | 
			
		||||
    };
 | 
			
		||||
  }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  async orderTransactionBillProd(
 | 
			
		||||
    orderTransactionDto: OrderTransactionDto,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user