Untitled
unknown
plain_text
2 years ago
490 B
12
Indexable
const incluirVenda = async (req, res) => {
try {
const venda = req.body;
const incluirIdVenda = await salesService.incluirProdutoNovo(venda);
const vendaDeProdutos = await salesService.vendasPorID(incluirIdVenda);
const vendaItem = vendaDeProdutos.map(({ productId, quantity }) => ({ productId, quantity }));
res.status(statos21).json({ id: incluirIdVenda, itemsSold: vendaItem });
} catch (error) {
res.status(statos5).json({ message: error.message });
}
};Editor is loading...
Leave a Comment