Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Fernando-Santana-j committed Nov 6, 2024
2 parents 9b16f26 + 4ceba45 commit 07fda1c
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 @@ -2155,7 +2155,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 @@ -2173,10 +2173,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 07fda1c

Please sign in to comment.