add endpoint spend by unit
This commit is contained in:
@ -60,3 +60,19 @@ exports.getMonthlyBudgetUtilization = (req, res) => {
|
||||
dashboardAdapter.sendResponse(502, apireshandler, res);
|
||||
}
|
||||
};
|
||||
|
||||
exports.getSpendByUnitChart = (req, res) => {
|
||||
try {
|
||||
dashboardAdapter.querySpendByUnitChart(req, function (err, data) {
|
||||
let statusCode = data != null ? data.meta.code : 200;
|
||||
|
||||
if (err) statusCode = 500;
|
||||
|
||||
dashboardAdapter.sendResponse(statusCode, data, res);
|
||||
});
|
||||
} catch (err) {
|
||||
apireshandler.meta.code = 502;
|
||||
apireshandler.meta.message = "Dashboard controller error : " + err.toString();
|
||||
dashboardAdapter.sendResponse(502, apireshandler, res);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user