diff --git a/static/app.js b/static/app.js index 6063942..07120cd 100644 --- a/static/app.js +++ b/static/app.js @@ -232,8 +232,6 @@ function selectBarMember(id, name, number, balance, balanceDisplay) { document.getElementById('barSelected').innerHTML = `${esc(name)}   #${esc(number)}   Balance: ${esc(balanceDisplay)}`; document.getElementById('barForm').classList.remove('hidden'); - document.getElementById('barProductSearch').value = ''; - document.getElementById('barProductResults').innerHTML = ''; setMsg('barMsg', '', ''); } @@ -243,46 +241,9 @@ function clearBarSelection() { document.getElementById('barAmount').value = ''; document.getElementById('barPin').value = ''; document.getElementById('barNote').value = ''; - document.getElementById('barProductSearch').value = ''; - document.getElementById('barProductResults').innerHTML = ''; setMsg('barMsg', '', ''); } -let productTimer = null; -async function barProductLookup() { - clearTimeout(productTimer); - productTimer = setTimeout(async () => { - const q = document.getElementById('barProductSearch').value.trim(); - if (!q) { document.getElementById('barProductResults').innerHTML = ''; return; } - try { - const products = await apiFetch(`/products?q=${encodeURIComponent(q)}`); - const div = document.getElementById('barProductResults'); - if (!products.length) { - div.innerHTML = '
No products found
'; - return; - } - div.innerHTML = products.map(p => ` -
-
- ${esc(p.name)}${p.brand ? ` – ${esc(p.brand)}` : ''} - ${p.search_tags ? `
${esc(p.search_tags)}
` : ''} -
-
- ${esc(p.price_display)} - ${p.member_price_display ? `mbr: ${esc(p.member_price_display)}` : ''} -
-
`).join(''); - } catch (e) { console.error(e); } - }, 250); -} - -function selectProduct(price, memberPrice, label) { - document.getElementById('barAmount').value = memberPrice; - document.getElementById('barNote').value = label; - document.getElementById('barProductResults').innerHTML = ''; - document.getElementById('barProductSearch').value = ''; -} - async function doCharge() { if (!barMember) return; const amount = parseInt(document.getElementById('barAmount').value, 10); diff --git a/static/bar.html b/static/bar.html index 509c88d..0306a34 100644 --- a/static/bar.html +++ b/static/bar.html @@ -27,12 +27,6 @@