let produtos = [...Produtos, data]
produtos= produtos.sort((a,b) => a.numero_volume - b.numero_volume)
setFiltro('')
var volume = data.volumes
var list = [];
for (var i = 1; i <= volume; i++) {
const p = produtos.find(p => p.numero_volume == i)
if(!p) {
list.push(`${i},`);
}
setLista(list)
}
setProdutos(produtos)
What returns me from this is
I need to remove the comma from the last string, remembering that the final number can be another, but it will always be the last number in ascending order
