Add custom serials

This commit is contained in:
Swift
2024-02-09 22:04:14 +03:30
parent ddb290241d
commit 7438a95166
9 changed files with 48 additions and 22 deletions
+3 -3
View File
@@ -4,10 +4,10 @@ const readXlsxFile = require('read-excel-file/node')
const guaranteeSerialsPath = './static/uploads/serials'
const productSerialsPath = './static/uploads/serials_products'
const serialChecker = async (serial, type = 'guaranteeSerial') => {
const serialChecker = async (serial, type = 'guaranteeSerial', g = 1) => {
let exelsPath
if (type === 'guaranteeSerial') exelsPath = guaranteeSerialsPath
if (type === 'orginality') exelsPath = productSerialsPath
if (type === 'guaranteeSerial') exelsPath = guaranteeSerialsPath + g
if (type === 'orginality') exelsPath = productSerialsPath + g
const lowerSerial = serial.toLowerCase()
// a promise to lowercase items and filter null or DateObjects