starting dashbaord stats retrieval

This commit is contained in:
Arjun Patel
2019-03-22 13:01:40 -07:00
parent 84180ff2e5
commit 8f80485692
2 changed files with 15 additions and 0 deletions
+13
View File
@@ -80,6 +80,19 @@ exports.deleteDonor = (req, res) => {
});
};
// GET the quick stats for the dashboard
exports.getDashboardData = async (req, res, next) => {
console.log(req.user);
const rows = await db.sequelize.query('Select * from donors', {
type: db.sequelize.QueryTypes.SELECT
});
res.status(200).json({
message: 'Successfully got the stats',
rows
});
};
// // Update a Donor
// exports.update = (req, res) => {
// const id = req.params.donor_id;
+2
View File
@@ -44,6 +44,8 @@ router.get(
organization.findOptimalBundleAmounts
);
router.get('/dashboard', checkAuth(roles.DONOR), donor.getDashboardData);
// // Retrieve a single Donor by Id
// router.get('/:donor_id', donor.findById);