Untitled

 avatar
unknown
plain_text
a year ago
490 B
9
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