Compare commits

...

1 Commits

Author SHA1 Message Date
20251144030027 37d8baf771 Mudando 2026-06-01 19:38:31 -03:00
+7 -6
View File
@@ -4,9 +4,7 @@ async function carregarProdutos(){
throw new Error("Não foi possível carregar a lista") throw new Error("Não foi possível carregar a lista")
} }
const produtos = await resposta.join(); const produtos = await resposta.join();
let tbody = document.querySelector("tbody");
let tbody = document.querySelector("tbody");
produtos.forEach(produto =>{ produtos.forEach(produto =>{
let linha = document.createElement("tr") let linha = document.createElement("tr")
linha.innerHTML = ` linha.innerHTML = `
@@ -14,7 +12,10 @@ async function carregarProdutos(){
<td>${produto.preco}</td> <td>${produto.preco}</td>
<td>${produto.estoque}</td> <td>${produto.estoque}</td>
` `
tbody.appendChild(linha);
tbody.appendChild });
})
} }
window.addEventListener("load", () => {
carregarProdutos();
})