From 00cb88b5f4957e94f18452b379d100fa396b617d Mon Sep 17 00:00:00 2001 From: joseph le Date: Thu, 12 Oct 2023 10:28:35 +0700 Subject: [PATCH] update sendDeviceInfo follow model special and RAM, flash --- app/utils/sendDeviceInfor.ts | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/app/utils/sendDeviceInfor.ts b/app/utils/sendDeviceInfor.ts index 078b013..632af4c 100644 --- a/app/utils/sendDeviceInfor.ts +++ b/app/utils/sendDeviceInfor.ts @@ -290,17 +290,18 @@ export const sendDeviceInfora = async () => { }); await Promise.all(filePromises); + let specialModel = allKeyValue + .filter((i) => i.key === "MODEL_SPECIAL") + .map((obj) => obj.$attributes.value); + listInformation = listInformation.filter( + (i) => + i.RAM !== "" || + i.flash !== "" || + specialModel.filter((m) => i.PID.includes(m)).length > 0 + ); if (listInformation.length > 0) { console.log(listInformation); - let specialModel = allKeyValue - .filter((i) => i.key === "MODEL_SPECIAL") - .map((obj) => obj.$attributes.value); - listInformation = listInformation.filter( - (i) => - i.RAM !== "" || - i.flash !== "" || - specialModel.filter((m) => i.PID.includes(m)).length > 0 - ); + listInformation.map((inf) => { html += `${inf.PID} ${inf.VID} @@ -311,8 +312,8 @@ export const sendDeviceInfora = async () => { }); const options = { from: "admin@apactech.io", - to: "joseph@apactech.io, ips@ipsupply.com.au", - // to: "joseph@apactech.io", + // to: "joseph@apactech.io, ips@ipsupply.com.au", + to: "joseph@apactech.io", subject: "(AUTO-REPORT) SERIAL NUMBER", html: "\