From bef081d4176d4b4656bee540a16e6ab371210089 Mon Sep 17 00:00:00 2001 From: Gowtham M Date: Wed, 12 Nov 2025 09:27:14 +0530 Subject: [PATCH] dashboard conflit resolved : GWM --- app/controllers/dashboard.controller.js | 29 ++++++++++++++----------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/app/controllers/dashboard.controller.js b/app/controllers/dashboard.controller.js index 6bb3171..de9d8d1 100644 --- a/app/controllers/dashboard.controller.js +++ b/app/controllers/dashboard.controller.js @@ -189,21 +189,24 @@ exports.adminDashboard = async (req, res) => { let { quarter, year } = req.query; // if quarter/year not passed → take latest open config - if (!quarter || !year) { - const lastConfig = await QuarterlyWindowsConfiguration.findOne({ - order: [ - ['year', 'DESC'], - ['quarter', 'DESC'] - ] - }); + // if (!quarter || !year) { + // const lastConfig = await QuarterlyWindowsConfiguration.findOne({ + // order: [ + // ['year', 'DESC'], + // ['quarter', 'DESC'] + // ] + // }); - if (lastConfig) { - quarter = lastConfig.quarter; - year = lastConfig.year; - } - } + // if (lastConfig) { + // quarter = lastConfig.quarter; + // year = lastConfig.year; + // } + // } + + let whereCond = {}; + if (quarter === 'All') quarter = null; + if (year === 'All') year = null; - const whereCond = {}; if (quarter) whereCond.quarter = quarter; if (year) whereCond.year = year;