From 84bc4403eab6c98141051eb6873616265a3fcf12 Mon Sep 17 00:00:00 2001 From: bewe <93899302+bernarduswillson@users.noreply.github.com> Date: Fri, 17 Nov 2023 13:56:18 +0700 Subject: [PATCH] fix: docker bug --- api/exercise/submit.php | 2 +- api/merch/buy.php | 2 +- api/merch/redeem.php | 4 ++-- app/views/confirmation/index.php | 2 +- app/views/merchandise/index.php | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/api/exercise/submit.php b/api/exercise/submit.php index d38872b..c8a2147 100644 --- a/api/exercise/submit.php +++ b/api/exercise/submit.php @@ -18,7 +18,7 @@ function submitQuiz($exerciseId, $exerciseName, $selectedOptions, $userId, $isDo } $ch = curl_init(); - curl_setopt($ch, CURLOPT_URL, "http://express:5000/exercise/result/" . $exerciseId . "?apiKey=" . getenv('REST_API_KEY')); + curl_setopt($ch, CURLOPT_URL, "http://express:5000/exercise/result/" . $exerciseId); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt( diff --git a/api/merch/buy.php b/api/merch/buy.php index 5ba939a..b66f5e9 100644 --- a/api/merch/buy.php +++ b/api/merch/buy.php @@ -3,7 +3,7 @@ function buyItem($merchId, $userId, $email) { // rest buy merchandise $ch = curl_init(); - curl_setopt($ch, CURLOPT_URL, "http://express:5000/merch/buy/" . $merchId . "?apiKey=" . getenv('REST_API_KEY')); + curl_setopt($ch, CURLOPT_URL, "http://express:5000/merch/buy/" . $merchId); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt( diff --git a/api/merch/redeem.php b/api/merch/redeem.php index 3c61ea3..c73962f 100644 --- a/api/merch/redeem.php +++ b/api/merch/redeem.php @@ -1,9 +1,9 @@ <?php function redeem($voucher, $userId) { - // rest buy merchandise + // rest redeem $ch = curl_init(); - curl_setopt($ch, CURLOPT_URL, "http://express:5000/voucher/use/" . $voucher . "?apiKey=" . getenv('REST_API_KEY')); + curl_setopt($ch, CURLOPT_URL, "http://express:5000/voucher/use/" . $voucher); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt( diff --git a/app/views/confirmation/index.php b/app/views/confirmation/index.php index 902c1d3..8cf8ac8 100644 --- a/app/views/confirmation/index.php +++ b/app/views/confirmation/index.php @@ -11,7 +11,7 @@ <? endif; ?> <div class="conf-items"> <div class="merch-item" - style="background-image: url('http://172.20.10.2:5000/image/?filename=<?= $data['merch']['image'] ?>');"> + style="background-image: url('http://localhost:5000/image/?filename=<?= $data['merch']['image'] ?>&apiKey=ax5kBNUxP2Cr0l8dwR472lMOiPeyJLRY7mKbTw0Cc8Z3hVW2kYmtAFcTNctI9139hHWUbJ5q3U8mRlZopXhFd9sTleg4lPr0DQkeMg3ntQZZFaTrASrWbc5QZ4CDIlPO');"> <div class="merch-image"></div> <div class="merch-details"> <div class="merch-name"> diff --git a/app/views/merchandise/index.php b/app/views/merchandise/index.php index 519a346..ee351e9 100644 --- a/app/views/merchandise/index.php +++ b/app/views/merchandise/index.php @@ -31,7 +31,7 @@ <div class="merchandise-items"> <? foreach ($data['merch'] as $merch): ?> <div class="merch-item" - style="background-image: url('http://172.20.10.2:5000/image/?filename=<?= $merch['image'] ?>');"> + style="background-image: url('http://localhost:5000/image/?filename=<?= $merch['image'] ?>&apiKey=ax5kBNUxP2Cr0l8dwR472lMOiPeyJLRY7mKbTw0Cc8Z3hVW2kYmtAFcTNctI9139hHWUbJ5q3U8mRlZopXhFd9sTleg4lPr0DQkeMg3ntQZZFaTrASrWbc5QZ4CDIlPO');"> <div class="merch-image"></div> <div class="merch-details"> <div class="merch-name"> -- GitLab