addition of new dashboard
This commit is contained in:
17
backend/modules/dashboard/index.js
Normal file
17
backend/modules/dashboard/index.js
Normal file
@@ -0,0 +1,17 @@
|
||||
import { dashboardApi } from "./api.js";
|
||||
|
||||
const routes = {
|
||||
'/api/v1/data/dashboard/summary': dashboardApi.summary,
|
||||
'/api/v1/data/dashboard/transactions': dashboardApi.transactions,
|
||||
'/api/v1/data/dashboard/series': dashboardApi.series,
|
||||
'/api/v1/data/dashboard/verify': dashboardApi.verify,
|
||||
'/api/v1/data/dashboard/event': dashboardApi.event,
|
||||
};
|
||||
|
||||
export async function dispatch(url, input, userId) {
|
||||
// hasOwn: a bare lookup resolves Object.prototype members to callables.
|
||||
if (!Object.hasOwn(routes, url)) return null;
|
||||
return routes[url](input, userId);
|
||||
}
|
||||
|
||||
export const dashboard = { dispatch };
|
||||
Reference in New Issue
Block a user