Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Fernando-Santana-j committed Nov 5, 2024
1 parent a4c7ee3 commit 4ceba45
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions Discord/discordIndex.js
Original file line number Diff line number Diff line change
Expand Up @@ -2161,7 +2161,7 @@ module.exports.sendProductPayment = async (params, id, type) => {
const element = carrinho[index];
var product = await products.find(product => product.productID == element.product)
var productIndex = await products.findIndex(product => product.productID == element.product)
const requestedQuantity = parseInt(element.quantidade);
const requestedQuantity = parseInt(element.quantidade) <= 0 ? 1 : parseInt(element.quantidade);
let typeProduct = 'typeProduct' in product ? product.typeProduct : 'normal'
productsName.push(`${product.productName} - ${element.quantidade}x`);

Expand All @@ -2179,10 +2179,7 @@ module.exports.sendProductPayment = async (params, id, type) => {
if (typeProduct == 'normal') {
try {
let itensCortados = await product.estoque.splice(0, requestedQuantity)
console.log(`itensCortados ${index}`,itensCortados);
let itens = itensCortados.map(item => item.conteudo)
console.log(`item${index}`,itens);

itens.forEach(item => {
arrayItensTxt.push(item[0].content)
})
Expand Down

0 comments on commit 4ceba45

Please sign in to comment.