diff --git a/gestaoRaul/balcao/templates/viewBalcao.html b/gestaoRaul/balcao/templates/viewBalcao.html index 7e966b3..97fa7d0 100644 --- a/gestaoRaul/balcao/templates/viewBalcao.html +++ b/gestaoRaul/balcao/templates/viewBalcao.html @@ -46,8 +46,8 @@ {{item.product.name}} R$ {{item.product.price}} - diff --git a/gestaoRaul/db.sqlite3 b/gestaoRaul/db.sqlite3 index 0a5b572..b879434 100644 Binary files a/gestaoRaul/db.sqlite3 and b/gestaoRaul/db.sqlite3 differ diff --git a/gestaoRaul/templates/htmx_components/htmx_list_products_in_balcao.html b/gestaoRaul/templates/htmx_components/htmx_list_products_in_balcao.html index 988064f..be7e9b1 100644 --- a/gestaoRaul/templates/htmx_components/htmx_list_products_in_balcao.html +++ b/gestaoRaul/templates/htmx_components/htmx_list_products_in_balcao.html @@ -8,7 +8,9 @@ {{item.product.name}} R$ {{item.product.price}} - + {% endfor %} diff --git a/gestaoRaul/templates/static/comandas/js/viewbalcao.js b/gestaoRaul/templates/static/comandas/js/viewbalcao.js index 18cf46c..5a52a0c 100644 --- a/gestaoRaul/templates/static/comandas/js/viewbalcao.js +++ b/gestaoRaul/templates/static/comandas/js/viewbalcao.js @@ -120,23 +120,32 @@ function addProductBalcao() { var qtd = document.getElementById('qtd-product').value; console.log(productId, comandaId) const url = `/balcao/addProductBalcaoTeclado${productId}/${comandaId}/${qtd}/`; - const listProductsBalcao = document.getElementById('list-products-balcao'); fetch(url, { method: 'GET', headers: { 'Content-Type': 'application/json' - }, - - }) - .then(function(response) { + },}).then(function(response) { return response.text(); - }).then(function(text) { + }).then(function(text) { var listProductsBalcaoElement = document.getElementById("list-products-balcao"); listProductsBalcaoElement.innerHTML = text; }) +} - // reloadPage() +function removeProductBalcao(id) { + + const url = `/balcao/removeProductBalcao${id}/`; + fetch(url, { + method: 'GET', + headers: { + 'Content-Type': 'application/json' + },}).then(function(response) { + return response.text(); + }).then(function(text) { + var listProductsBalcaoElement = document.getElementById("list-products-balcao"); + listProductsBalcaoElement.innerHTML = text; + }) }