import { Router } from 'express';
import { ViewAsyncDashboardController } from './controller.js';
import { validateFilters } from '../../../../../validation/validateFilters.js';
import { loadReportDefinition } from '../../../../../middleware/loadReportDefinition.js';

/* eslint-disable no-param-reassign */
function routes({ layoutPath, services }) {
    const router = Router({ mergeParams: true });
    const controller = new ViewAsyncDashboardController(layoutPath, services);
    router.get(`/`, controller.GET);
    router.post('/apply-filters', loadReportDefinition(services), validateFilters({ interactive: true }), controller.applyFilters);
    router.post('/reset-filters', controller.resetFilters);
    return router;
}

export { routes as default, routes };
//# sourceMappingURL=routes.js.map
