Enhance search trail result, fix trigger cron update button

This commit is contained in:
Afiq Hamzah
2025-04-10 10:10:34 +08:00
parent 9a9e870ec2
commit 1e32f087c0
2 changed files with 8 additions and 7 deletions
@@ -34,7 +34,6 @@ class OnlineTransactionTrailController extends Controller
$statuses = [
'PAID',
'NOT PAID',
'UNSUCCESSFUL',
];
$queries = [
@@ -91,8 +91,6 @@
</span>
<select id="selectedStatus" name="selectedStatus"
class="border-2 border-l-0 rounded-r px-4 py-2 w-80r mr-2 bg-white text-gray-700 focus:outline-none focus:border-yellow-500 flex-grow">
<option value="" {{ $selectedStatus === '' ? 'selected' : '' }}>ALL
</option>
@foreach ($statuses as $status)
<option value="{{ $status }}" {{ $selectedStatus == $status ? 'selected' : '' }}>
{{ $status }}
@@ -232,13 +230,17 @@
alert('This will trigger cron job to update the status of the transaction');
let cronUrl = '{{ config("api.url") . "/api/transaction/online/update" }}';
let cronUrlPKB = '{{ config("api.url_pkb") . "/api/transaction/online/update" }}';
let cronUrlKOPKB = '{{ config("api.url_koop") . "/api/transaction/online/update" }}';
let callCronUpdate = () => fetch(cronUrl).then(response => response.json());
let callCronUpdatePKB = () => fetch(cronUrlPKB).then(response => response.json());
let callCronUpdateKOPKB = () => fetch(cronUrlKOPKB).then(response => response.json());
let response = await callCronUpdate();
let responseCronUrlPKB = await callCronUpdatePKB();
let responseCronUrlKOPKB = await callCronUpdateKOPKB();
alert(cronUrl + ' responded with: ' + response + '\n\n page will now reload');
alert(cronUrlPKB + ' responded with: ' + responseCronUrlPKB + '\n\n page will now reload');
alert(cronUrlKOPKB + ' responded with: ' + responseCronUrlKOPKB + '\n\n page will now reload');
window.location.reload();
}