added return ajax and fetch only can surf showavailable-carts

This commit is contained in:
hafifierahman
2025-01-21 02:51:07 +08:00
parent a370adc2d0
commit 9d7478159f
6 changed files with 47 additions and 27 deletions
+8 -2
View File
@@ -209,7 +209,7 @@
const loader = document.getElementById('load-arrahn');
loader.classList.remove('d-none');
if (result.isDenied) {
let remove_carts = fetch('/deletecarts')
let remove_carts = fetch('/deletecarts', {method: 'GET', headers: {'Content-Type': 'application/json','Accept': 'application/json'}})
.then(response => {
if (!response.ok) {
throw new Error('HTTP error ' + response.status);
@@ -227,7 +227,13 @@
const checkCarts = async () => {
try {
const response = await fetch('/showcarts-available');
const response = await fetch('/showcarts-available', {
method: 'GET',
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json',
},
});
if (!response.ok) {
throw new Error('HTTP error ' + response.status);
@@ -74,9 +74,6 @@
{{-- <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDTTfWur0PDbZWPr7Pmq8K3jiDp0_xUziI"></script> --}}
<script src="{{ asset('assets/js/material-kit/material-kit.min.js?v=3.0.0') }}" type="text/javascript"></script>
<script>
</script>
<script>
if (document.getElementsByClassName('page-header')) {
window.onscroll = debounce(function() {
@@ -131,6 +131,7 @@
<div class="col-12 text-center" id="rem">
@csrf
<input type="hidden" name="billplzid" value="{{ $payment_details['billplz_id'] }}">
<input type="hidden" name="norujukan" value="{{ $payment_details['norujukan'] }}">
<input type="hidden" name="company" value="{{ $company }}">
<a class="btn btn-primary"onclick="loadingbtn();" href="{{ route('home') }}">Kembali Muka Hadapan</a>
<button class="btn btn-primary" onclick="cetakresit()">Cetak Resit</button>