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:
@@ -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;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user