fix(loyalty): use confirm modal for category deletion
Some checks failed
Some checks failed
Replace browser confirm() dialog with the shared confirm_modal macro for category deletion. Matches the existing program delete pattern. Shows warning about impact on existing transactions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -152,7 +152,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Delete Confirmation Modal -->
|
||||
<!-- Delete Program Confirmation Modal -->
|
||||
{{ confirm_modal(
|
||||
'deleteProgramModal',
|
||||
_('loyalty.admin.merchant_detail.delete_title'),
|
||||
@@ -164,6 +164,18 @@
|
||||
'danger'
|
||||
) }}
|
||||
|
||||
<!-- Delete Category Confirmation Modal -->
|
||||
{{ confirm_modal(
|
||||
'deleteCategoryModal',
|
||||
_('loyalty.common.delete'),
|
||||
_('loyalty.admin.merchant_detail.delete_category_message'),
|
||||
'confirmDeleteCategory()',
|
||||
'showDeleteCategoryModal',
|
||||
_('loyalty.common.delete'),
|
||||
_('loyalty.common.cancel'),
|
||||
'danger'
|
||||
) }}
|
||||
|
||||
<!-- Location Breakdown -->
|
||||
<div x-show="locations.length > 0" class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800">
|
||||
<h3 class="mb-4 text-lg font-semibold text-gray-700 dark:text-gray-200">
|
||||
@@ -287,7 +299,7 @@
|
||||
class="text-sm" :class="cat.is_active ? 'text-orange-500 hover:text-orange-700' : 'text-green-500 hover:text-green-700'">
|
||||
<span x-html="$icon(cat.is_active ? 'ban' : 'play', 'w-4 h-4')"></span>
|
||||
</button>
|
||||
<button @click="deleteCategory(cat.id)" type="button"
|
||||
<button @click="categoryToDelete = cat.id; showDeleteCategoryModal = true" type="button"
|
||||
aria-label="{{ _('loyalty.common.delete') }}"
|
||||
class="text-red-500 hover:text-red-700">
|
||||
<span x-html="$icon('trash', 'w-4 h-4')"></span>
|
||||
|
||||
Reference in New Issue
Block a user