add middleware writeLog

This commit is contained in:
joseph le 2023-09-29 16:54:51 +07:00
parent 9350f061c5
commit ccfd6cc0ad
3 changed files with 4 additions and 3 deletions

1
.gitignore vendored
View File

@ -5,4 +5,5 @@ coverage
.DS_STORE
.env
app/utils/indexSN.txt
app/store
tmp

View File

@ -109,7 +109,7 @@ export default class ErpsController {
?.split(":")[1]
?.replace("\r", "")
.trim() !== "" &&
SN !== "N/A" && SN !== "NA" && SN.length>4
SN !== "N/A" && SN.length>4
) {
if (output.some((u) => u.SN === SN)) {
output.map((u, index) => {
@ -283,7 +283,7 @@ export default class ErpsController {
);
// console.log(report);
return report.filter(
(i) => i.SN !== "" && /^[A-Z0-9-]{5,}$/.test(i.SN) === true && i.PID !=="" && SN!=="NA"
(i) => i.SN !== "" && /^[A-Z0-9-]{5,}$/.test(i.SN) === true && i.PID !==""
);
// }, 15000);
} catch (error) {

View File

@ -201,7 +201,7 @@ runtimeCheckLogs(Env.get("FOLDER_LOGS"));
Route.post("/api/getIndexSerialNumber", "ErpsController.getIndexSerialNumber")
.middleware("checkToken")
.middleware("writeLog");
// .middleware("writeLog");
Route.post("/api/getParagraph", "ErpsController.getParagraph")
.middleware("checkToken")