import { Router } from 'express';
import { ViewSyncDashboardController } from './controller.js';
import { loadReportDefinition } from '../../../../../middleware/loadReportDefinition.js';
import { validateFilters } from '../../../../../validation/validateFilters.js';
import { LoadType } from '../../../../../types/UserReports.js';

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

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