starting dashbaord stats retrieval
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user