completed the send SMS which uses the first client App API key

This commit is contained in:
Kwesi Banson Jnr
2026-04-05 09:09:04 +00:00
parent 595e7a6531
commit 2064c2d6e5
4 changed files with 39 additions and 34 deletions

View File

@@ -33,7 +33,7 @@
<tr>
<td class="fw-semibold">{{ $row->name}}</td>
<td class="recipient-cellss">
<div class="fw-semibold">{{ $row->type}}</div>
<div class="fw-semibold">{{ $row->type }}</div>
</td>
<td class="text-wrap text-break apiKeyCell" style="max-width: 100px;">
<i class="bi bi-eye viewApiKeyIcon"></i>

View File

@@ -57,34 +57,37 @@
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
<script src="{{ url('public/libs/jquery-3.2.1.min.js') }}"></script>
<script src="{{ url('public/libs/jquery-confirm/jquery-confirm.min.js') }}"></script>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
@yield('page-js')
<script>
const myForm = document.getElementById('clientNewAppForm');
myForm.addEventListener('submit', function(e) {
// 2. Stop the page reload
e.preventDefault();
// 3. Extract data from the form
const formData = new FormData(this);
const formAction = $(this).attr("action");
// Convert to JSON if your API requires it (common for modern backends)
const data = Object.fromEntries(formData.entries());
// 4. Execute the AJAX (Fetch) request
fetch(formAction, {
method: 'POST',
headers: {
'Content-Type': 'application/json', // Inform server of JSON content
'Accept': 'application/json' // Expect JSON response
'Content-Type': 'application/json',
'Accept': 'application/json'
},
body: JSON.stringify(data)
})
.then(response => response.json())
.then(result => {
console.log('Success:', result);
// 5. Optional: Close modal or show success message
alert('Data submitted successfully!');
// $.alert('Data submitted successfully!');
Swal.fire({
title: "Sucess",
text: "New App successfully created",
icon: "success"
});
this.reset();
setTimeout(() => { location.reload(); }, 2000);
})
.catch(error => {
console.error('Error:', error);