From c58e3f281bc81906eeab5df6c725d1a511156e03 Mon Sep 17 00:00:00 2001 From: Fadli Date: Tue, 30 Aug 2022 14:45:34 +0700 Subject: [PATCH] - fix order prod error when checking status --- src/transaction/transaction.service.ts | 40 +++++++++++++------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/transaction/transaction.service.ts b/src/transaction/transaction.service.ts index 2fc835d..652acec 100644 --- a/src/transaction/transaction.service.ts +++ b/src/transaction/transaction.service.ts @@ -310,15 +310,15 @@ export class TransactionService { 'prepaid', ); - if (!productData.statusHistory.status.includes('ACTIVE')) { - throw new HttpException( - { - statusCode: HttpStatus.INTERNAL_SERVER_ERROR, - error: `Transaction Failed because product is not active`, - }, - HttpStatus.INTERNAL_SERVER_ERROR, - ); - } else { + // if (!productData.statusHistory.status.includes('ACTIVE')) { + // throw new HttpException( + // { + // statusCode: HttpStatus.INTERNAL_SERVER_ERROR, + // error: `Transaction Failed because product is not active`, + // }, + // HttpStatus.INTERNAL_SERVER_ERROR, + // ); + // } else { const trxId = Array(6) .fill(null) @@ -454,7 +454,7 @@ export class TransactionService { amount: product_price.mark_up_price + product_price.price, status: statusTransaction[statusTransaction.SUCCESS], }; - } + // } } async orderTransactionProd( @@ -467,15 +467,15 @@ export class TransactionService { 'prepaid', ); - if (!productData.statusHistory.status.includes('ACTIVE')) { - throw new HttpException( - { - statusCode: HttpStatus.INTERNAL_SERVER_ERROR, - error: `Transaction Failed because product is not active`, - }, - HttpStatus.INTERNAL_SERVER_ERROR, - ); - } else { + // if (!productData.statusHistory.status.includes('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 @@ -692,7 +692,7 @@ export class TransactionService { amount: product_price.mark_up_price + product_price.price, status: status, }; - } + // } } async orderTransactionBillProd(