admin dashboard api created_by_name added
This commit is contained in:
parent
ef9154923f
commit
638819495e
@ -256,12 +256,22 @@ exports.adminDashboard = async (req, res) => {
|
||||
)`),
|
||||
"product_count",
|
||||
],
|
||||
[
|
||||
Sequelize.literal(`(
|
||||
SELECT eu.name
|
||||
FROM establishment_users eu
|
||||
WHERE eu.id = submission.created_by
|
||||
LIMIT 1
|
||||
)`),
|
||||
"created_by_name"
|
||||
]
|
||||
],
|
||||
},
|
||||
order: [["created_at", "DESC"]],
|
||||
limit: 10,
|
||||
});
|
||||
|
||||
console.log(recentSubmissions,'geetha')
|
||||
return res.status(200).json({
|
||||
status: "success",
|
||||
selected_quarter: quarter,
|
||||
|
||||
@ -45,7 +45,7 @@ exports.createSubmission = async (req, res) => {
|
||||
const currentResponded = config.responded ?? 0;
|
||||
const currentNotResponded = config.not_responded ?? 0;
|
||||
// respond increase, not responded decrease
|
||||
await QuarterlyWindowsConfiguration.update({responded: currentResponded + 1, not_responded: currentNotResponded - 1, updated_by: req.user.id, updated_at: new Date() }, {where: { id: config.id }} );
|
||||
await QuarterlyWindowsConfiguration.update({responded: currentResponded + 1, not_responded: currentNotResponded - 1, updated_at: new Date() }, {where: { id: config.id }} );
|
||||
}
|
||||
|
||||
if (products.length) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user