From bdce94488fd76281004193ae0dcf6bdadde2e4ba Mon Sep 17 00:00:00 2001 From: Fernando Date: Sun, 17 Nov 2024 09:36:31 -0300 Subject: [PATCH] fix --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 82bc5b8..34376d2 100644 --- a/index.js +++ b/index.js @@ -313,7 +313,7 @@ app.get('/server/sales/:id', functions.authGetState, functions.subscriptionStatu }); - let productsSimple = server.products.filter(product => { + let productsSimple = 'products' in server ? server.products.filter(product => { let typeProduct = 'typeProduct' in product ? product.typeProduct : 'normal'; return typeProduct != 'multiple'; }).map(product => { @@ -335,7 +335,7 @@ app.get('/server/sales/:id', functions.authGetState, functions.subscriptionStatu desc: `Preço: ${functions.formatarMoeda(product.price)} • Estoque: ${estoqueNumber}`, value: product.productID } - }) + }) : [] res.render('sales', { perms: verifyPerms.perms, chatItens: chatItens, host: `${webConfig.host}`, bankData: bankData, user: user, server: server, cargosString: JSON.stringify(roleObjects), channels: textChannels, channelsString: JSON.stringify(textChannels), formatarMoeda: functions.formatarMoeda, productString: JSON.stringify(productsSimple) }) })