Mudando
This commit is contained in:
parent
45f4b50233
commit
37d8baf771
|
|
@ -4,9 +4,7 @@ async function carregarProdutos(){
|
|||
throw new Error("Não foi possível carregar a lista")
|
||||
}
|
||||
const produtos = await resposta.join();
|
||||
|
||||
let tbody = document.querySelector("tbody");
|
||||
|
||||
let tbody = document.querySelector("tbody");
|
||||
produtos.forEach(produto =>{
|
||||
let linha = document.createElement("tr")
|
||||
linha.innerHTML = `
|
||||
|
|
@ -14,7 +12,10 @@ async function carregarProdutos(){
|
|||
<td>${produto.preco}</td>
|
||||
<td>${produto.estoque}</td>
|
||||
`
|
||||
|
||||
tbody.appendChild
|
||||
})
|
||||
tbody.appendChild(linha);
|
||||
});
|
||||
}
|
||||
|
||||
window.addEventListener("load", () => {
|
||||
carregarProdutos();
|
||||
})
|
||||
Loading…
Reference in New Issue