diff --git a/index.html b/index.html index 9948837..b1ebcad 100644 --- a/index.html +++ b/index.html @@ -10,5 +10,6 @@ - + + diff --git a/scripts/main.js b/scripts/main.js index 11bf7d8..1cee2fe 100644 --- a/scripts/main.js +++ b/scripts/main.js @@ -15,4 +15,12 @@ async function loadProducts() { all_products = await makeAPIRequest(loadProductRequest) console.log("Loaded products:", all_products) } - \ No newline at end of file + +function scan_product() { + const barcode = document.getElementById('barcode_input').value + for (index = 0; index < all_products.length; index++) { + if (all_products[index].barcode == barcode) { + console.log(all_products[index]) + } + } +} \ No newline at end of file