diff --git a/app/controllers/dashboard.controller.js b/app/controllers/dashboard.controller.js index 773fd6a..accca30 100644 --- a/app/controllers/dashboard.controller.js +++ b/app/controllers/dashboard.controller.js @@ -167,13 +167,12 @@ exports.adminDashboard = async (req, res) => { } } - - const QuarterlyWindows = await QuarterlyWindowsConfiguration.findOne({ where: whereCond }); - const whereCond = {}; if (quarter) whereCond.quarter = quarter; if (year) whereCond.year = year; + const quarterlyWindows = await QuarterlyWindowsConfiguration.findOne({ where: whereCond }); + const totalEstablishments = await Establishment.count(); const submittedCount = await Submission.count({ where: { ...whereCond, status: "Submitted" } }); const approvedCount = await Submission.count({ where: { ...whereCond, status: "Approved" } }); @@ -234,7 +233,7 @@ exports.adminDashboard = async (req, res) => { pending: pendingCount, not_started: notStartedCount, }, - quarterly_windows : QuarterlyWindows, + quarterly_windows : quarterlyWindows, recent_submissions: recentSubmissions, });