diff --git a/app/modules/loyalty/static/store/js/loyalty-terminal.js b/app/modules/loyalty/static/store/js/loyalty-terminal.js index 11553964..ac5114d8 100644 --- a/app/modules/loyalty/static/store/js/loyalty-terminal.js +++ b/app/modules/loyalty/static/store/js/loyalty-terminal.js @@ -25,6 +25,7 @@ function storeLoyaltyTerminal() { selectedCard: null, searchResults: [], showSearchDropdown: false, + searchingCustomers: false, _searchTimeout: null, // Transaction inputs @@ -161,6 +162,7 @@ function storeLoyaltyTerminal() { }, async searchCustomers() { + this.searchingCustomers = true; try { const params = new URLSearchParams({ search: this.searchQuery, @@ -176,6 +178,8 @@ function storeLoyaltyTerminal() { loyaltyTerminalLog.warn('Search failed:', error.message); this.searchResults = []; this.showSearchDropdown = false; + } finally { + this.searchingCustomers = false; } }, diff --git a/app/modules/loyalty/templates/loyalty/store/terminal.html b/app/modules/loyalty/templates/loyalty/store/terminal.html index ebcca41c..ff6deb9a 100644 --- a/app/modules/loyalty/templates/loyalty/store/terminal.html +++ b/app/modules/loyalty/templates/loyalty/store/terminal.html @@ -3,6 +3,7 @@ {% from 'shared/macros/headers.html' import page_header_flex %} {% from 'shared/macros/alerts.html' import loading_state, error_state %} {% from 'shared/macros/modals.html' import modal_simple %} +{% from 'shared/macros/inputs.html' import search_autocomplete %} {% block title %}{{ _('loyalty.store.terminal.title') }}{% endblock %} @@ -64,48 +65,21 @@