This commit is contained in:
Gowtham M 2025-11-07 12:26:10 +05:30
parent 76e972cf34
commit f9d2aa4a26

View File

@ -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,
});