- fix order prod error when checking status

This commit is contained in:
Fadli 2022-08-30 14:45:34 +07:00
parent 52d712fd05
commit c58e3f281b

View File

@ -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(