diff --git a/app/controllers/dashboard.controller.js b/app/controllers/dashboard.controller.js index 21bbfd0..51d2b21 100644 --- a/app/controllers/dashboard.controller.js +++ b/app/controllers/dashboard.controller.js @@ -167,12 +167,15 @@ exports.adminDashboard = async (req, res) => { } } + + const lastConfig = await QuarterlyWindowsConfiguration.findOne({ where: whereCond }); + const whereCond = {}; if (quarter) whereCond.quarter = quarter; if (year) whereCond.year = year; const totalEstablishments = await Establishment.count(); - const submittedCount = await Submission.count({ where: whereCond }); + const submittedCount = await Submission.count({ where: { ...whereCond, status: "Submitted" } }); const approvedCount = await Submission.count({ where: { ...whereCond, status: "Approved" } }); const rejectedCount = await Submission.count({ where: { ...whereCond, status: "Rejected" } }); const pendingCount = await Submission.count({ where: { ...whereCond, status: "Pending" } });