dashboard conflit resolved : GWM
This commit is contained in:
parent
c5ec47f201
commit
bef081d417
@ -189,21 +189,24 @@ exports.adminDashboard = async (req, res) => {
|
|||||||
let { quarter, year } = req.query;
|
let { quarter, year } = req.query;
|
||||||
|
|
||||||
// if quarter/year not passed → take latest open config
|
// if quarter/year not passed → take latest open config
|
||||||
if (!quarter || !year) {
|
// if (!quarter || !year) {
|
||||||
const lastConfig = await QuarterlyWindowsConfiguration.findOne({
|
// const lastConfig = await QuarterlyWindowsConfiguration.findOne({
|
||||||
order: [
|
// order: [
|
||||||
['year', 'DESC'],
|
// ['year', 'DESC'],
|
||||||
['quarter', 'DESC']
|
// ['quarter', 'DESC']
|
||||||
]
|
// ]
|
||||||
});
|
// });
|
||||||
|
|
||||||
if (lastConfig) {
|
// if (lastConfig) {
|
||||||
quarter = lastConfig.quarter;
|
// quarter = lastConfig.quarter;
|
||||||
year = lastConfig.year;
|
// year = lastConfig.year;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
let whereCond = {};
|
||||||
|
if (quarter === 'All') quarter = null;
|
||||||
|
if (year === 'All') year = null;
|
||||||
|
|
||||||
const whereCond = {};
|
|
||||||
if (quarter) whereCond.quarter = quarter;
|
if (quarter) whereCond.quarter = quarter;
|
||||||
if (year) whereCond.year = year;
|
if (year) whereCond.year = year;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user