Update asanServiceSerialChecker.js
This commit is contained in:
@@ -14,10 +14,12 @@ const serialChecker = async (serial, type = 'guaranteeSerial', g = 1) => {
|
||||
|
||||
try {
|
||||
const serialFiles = await fs.readdirSync(exelsPath);
|
||||
|
||||
if((serialFiles?.length) <= 1){
|
||||
rej("این کد در سامانه موجود نیست")
|
||||
}
|
||||
serialFiles.forEach(async(file, i)=>{
|
||||
const exelFile = await readXlsxFile(`${exelsPath}/${file}`);
|
||||
|
||||
|
||||
for (const row of exelFile) {
|
||||
for (const col of row) {
|
||||
if (col == lowerSerial) {
|
||||
@@ -33,7 +35,7 @@ const serialChecker = async (serial, type = 'guaranteeSerial', g = 1) => {
|
||||
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
rej(new Error(e));
|
||||
rej(e);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user