From 8f731226eed47fbec3341c019c3be3129724c0a4 Mon Sep 17 00:00:00 2001 From: Muhammad Fadli Date: Thu, 14 Sep 2023 15:02:36 +0700 Subject: [PATCH] - fix when base url stg cannot order on prod --- src/transaction/transaction.controller.ts | 27 ++++++++++++++++------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/src/transaction/transaction.controller.ts b/src/transaction/transaction.controller.ts index 9213032..8fd660e 100644 --- a/src/transaction/transaction.controller.ts +++ b/src/transaction/transaction.controller.ts @@ -90,14 +90,25 @@ export class TransactionController { @Body() orderTransactionDto: OrderTransactionDto, @Request() req, ) { - return { - data: await this.transactionService.orderTransactionProd( - orderTransactionDto, - req.user, - ), - statusCode: HttpStatus.CREATED, - message: 'success', - }; + if (req.get('host').includes('ppob-backend.k3s.bangun-kreatif.com')) { + return { + data: await this.transactionService.orderTransaction( + orderTransactionDto, + req.user, + ), + statusCode: HttpStatus.CREATED, + message: 'success', + }; + } else { + return { + data: await this.transactionService.orderTransactionProd( + orderTransactionDto, + req.user, + ), + statusCode: HttpStatus.CREATED, + message: 'success', + }; + } } @Post('order-bill-prod')