final
This commit is contained in:
@@ -55,7 +55,7 @@ module.exports.getAllExels = [
|
||||
const validValues = ['guaranteeSerial', 'orginality']
|
||||
if (!validValues.includes(type)) return res500(res, 'choose type')
|
||||
const path = (type === 'guaranteeSerial' ? guaranteeSerialsPath : productSerialsPath) + `/${g}`
|
||||
const downloadAblePath = type === 'guaranteeSerial' ? '/uploads/serials/' : '/uploads/serials_products/'
|
||||
const downloadAblePath = (type === 'guaranteeSerial' ? '/uploads/serials' : '/uploads/serials_products') + `/${g}`
|
||||
fs.readdir(path, (err, files) => {
|
||||
if (err) return res500(res, err)
|
||||
const filesWithURL = files.map(item => {
|
||||
@@ -113,6 +113,7 @@ module.exports.checkSerial = [
|
||||
if (serialStatus) return res.json({ message: okMsg })
|
||||
else return res404(res, errMsg)
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
return res500(res, `there is an error here --- ${e}`)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user