refactor(loyalty): use search_autocomplete macro for terminal lookup

Replace custom inline autocomplete HTML with the shared
search_autocomplete macro from inputs.html. Same behavior (debounced
search, dropdown with name + email, loading/no-results states) but
using the established reusable component.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-23 21:24:00 +01:00
parent 040cbd1962
commit 5a33f68743
2 changed files with 20 additions and 42 deletions

View File

@@ -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;
}
},