progress on customer data
This commit is contained in:
@@ -61,8 +61,8 @@ function displayCustomers(customers) {
|
||||
<i class="fa-solid fa-eye mr-2"></i>
|
||||
View
|
||||
</button>
|
||||
<button class="edit-customer-btn inline-flex items-center px-3 py-2 bg-gradient-to-r from-blue-600 to-blue-700 dark:from-blue-700 dark:to-blue-800 text-white hover:from-blue-700 hover:to-blue-800 dark:hover:from-blue-600 dark:hover:to-blue-700 rounded-lg text-sm font-semibold transition-all duration-200 shadow-sm hover:shadow-md">
|
||||
<i class="fa-solid fa-pencil mr-2"></i>
|
||||
<button class="edit-customer-btn" style="display: inline-flex; align-items: center; background-color: #dc2626; color: white; padding: 8px 12px; border-radius: 6px; border: none; font-weight: 600; font-size: 14px;">
|
||||
<i class="fa-solid fa-pencil" style="margin-right: 8px;"></i>
|
||||
Edit
|
||||
</button>
|
||||
</div>
|
||||
@@ -524,6 +524,23 @@ async function saveCustomer() {
|
||||
return;
|
||||
}
|
||||
|
||||
// Double confirm for edits
|
||||
if (isEditing) {
|
||||
const confirmMessage = `Are you sure you want to update customer "${customerData.last}"? This will permanently modify the customer record.`;
|
||||
const firstConfirm = confirm(confirmMessage);
|
||||
|
||||
if (!firstConfirm) {
|
||||
return; // User cancelled
|
||||
}
|
||||
|
||||
// Second confirmation
|
||||
const secondConfirm = confirm('Please confirm again: Do you really want to save these changes? This action cannot be undone.');
|
||||
|
||||
if (!secondConfirm) {
|
||||
return; // User cancelled on second confirmation
|
||||
}
|
||||
}
|
||||
|
||||
let response;
|
||||
if (isEditing) {
|
||||
// Update existing customer
|
||||
|
||||
Reference in New Issue
Block a user