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;
|
||||
|
||||
// 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;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user