From 68e825b1e13b3de9fa00bf3631a9d21114c99418 Mon Sep 17 00:00:00 2001 From: saif Date: Wed, 19 Feb 2025 09:15:23 +0500 Subject: [PATCH] fix minor bug --- sync-orders.js | 15 +++++++-------- utils.js | 2 +- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/sync-orders.js b/sync-orders.js index 1722304..bc20401 100644 --- a/sync-orders.js +++ b/sync-orders.js @@ -122,10 +122,15 @@ const emailUtils = require("./email-utils"); waitUntil: ["domcontentloaded"], }); + // generate json from excel mark it processed + const unprocessedFolderPath = path.join( + config[environment].temu_orders_path, + "unprocessed" + ); + /* * request order report */ - try { const orderRequestSelector = "div._3yOxLjm0._2pgGmJ7w.IoqjAtdZ.vbGE0cGC"; const element = await page.$(orderRequestSelector); @@ -224,14 +229,8 @@ const emailUtils = require("./email-utils"); // wait 60 seconds await new Promise((resolve) => setTimeout(resolve, 30 * 1000)); - - // generate json from excel mark it processed - const unprocessedFolderPath = path.join( - config[environment].temu_orders_path, - "unprocessed" - ); } catch (e) { - emailUtils.notify( `Sync Temu Orders`, e.message ); + emailUtils.notify(`Sync Temu Orders`, e.message); } // Function to read Excel files and convert to JSON diff --git a/utils.js b/utils.js index 7d6dd2b..6a0bb73 100644 --- a/utils.js +++ b/utils.js @@ -329,7 +329,7 @@ exports.getFirstDayToCurrentMonth = getFirstDayToCurrentMonth; * write a function to convert UTC into pakistan standard time using luxon libraryy in 12 hour */ const getPakistanStandardTime = function( utcTime ){ - return DateTime.fromISO( utcTime ).setZone('Asia/Karachi').toFormat('dd-MMM-yyyy HH:mm:ss a'); + return DateTime.fromISO( utcTime ).setZone('Asia/Karachi').toFormat('dd-MMM-yyyy hh:mm:ss a'); } exports.getPakistanStandardTime = getPakistanStandardTime;