diff --git a/assets/controllers/toast_controller.js b/assets/controllers/toast_controller.js
index 0c81e5f..c7b7319 100644
--- a/assets/controllers/toast_controller.js
+++ b/assets/controllers/toast_controller.js
@@ -24,14 +24,25 @@ export default class extends Controller {
}
handleNotifications(event) {
+ console.log('[VOUCHER DEBUG] showNotifications event received:', event)
+ console.log('[VOUCHER DEBUG] event.detail:', event.detail)
+
// HTMX wraps the trigger value in an object with 'value' and 'elt' properties
// event.detail.value contains the actual array from the HX-Trigger header
- const notifications = event.detail?.value || []
+ const notifications = event.detail?.value || event.detail || []
- notifications.forEach(notification => {
- const className = this.getClassForType(notification.type)
- this.showToast(notification.message, className)
- })
+ console.log('[VOUCHER DEBUG] notifications array:', notifications)
+ console.log('[VOUCHER DEBUG] notifications count:', Array.isArray(notifications) ? notifications.length : 'not an array')
+
+ if (Array.isArray(notifications)) {
+ notifications.forEach((notification, index) => {
+ console.log(`[VOUCHER DEBUG] Processing notification ${index}:`, notification)
+ const className = this.getClassForType(notification.type)
+ this.showToast(notification.message, className)
+ })
+ } else {
+ console.error('[VOUCHER DEBUG] Notifications is not an array:', notifications)
+ }
}
showToast(text, className = '') {
@@ -49,6 +60,7 @@ export default class extends Controller {
const typeMap = {
'success': 'toastify--success',
'warning': 'toastify--warning',
+ 'error': 'toastify--error',
'info': 'toastify--info',
}
diff --git a/assets/styles/components/toast.css b/assets/styles/components/toast.css
index 5d9734b..81832e5 100644
--- a/assets/styles/components/toast.css
+++ b/assets/styles/components/toast.css
@@ -14,6 +14,11 @@
background: theme('colors.red.600');
}
+.toastify--error {
+ @apply text-gray-100;
+ background: theme('colors.red.700');
+}
+
.toastify--info {
@apply text-gray-100;
background: theme('colors.primary');
diff --git a/templates/booking/_summary.html.twig b/templates/booking/_summary.html.twig
index b908f9d..7400f28 100644
--- a/templates/booking/_summary.html.twig
+++ b/templates/booking/_summary.html.twig
@@ -48,18 +48,17 @@
{% if cmsData.hotel.images is defined %}
{% endif %}
- {% if cmsData.hotel.address is defined %}
-