From 51d1198a67d626eb6297d4ac9deab4a965d628a1 Mon Sep 17 00:00:00 2001 From: Fernando Date: Sun, 26 May 2024 08:11:29 -0300 Subject: [PATCH] fix --- stripe/productsRoutes.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/stripe/productsRoutes.js b/stripe/productsRoutes.js index 6865f5a..c70b493 100644 --- a/stripe/productsRoutes.js +++ b/stripe/productsRoutes.js @@ -329,14 +329,17 @@ router.post('/estoque/txt', async (req, res) => { await file.forEach(element => { - finalEstoqueArr.push({ - conteudo:[ - { - title: title, - content:element - } - ] - }) + element = element.trim() + if (element && element != '' && element != null && element != undefined) { + finalEstoqueArr.push({ + conteudo:[ + { + title: title, + content:element + } + ] + }) + } }); finalEstoqueArr = await finalEstoqueArr.filter(linha => linha.conteudo[0].content.length > 0) produtos[index] = product