'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var express = require('express');
var controller = require('./controller.js');
var loadReportDefinition = require('../../../../../middleware/loadReportDefinition.js');
var validateFilters = require('../../../../../validation/validateFilters.js');
var UserReports = require('../../../../../types/UserReports.js');

/* eslint-disable no-param-reassign */
function routes({ layoutPath, services }) {
    const router = express.Router({ mergeParams: true });
    const controller$1 = new controller.ViewSyncReportController(layoutPath, services);
    router.get([`/`, `/download-disabled`], controller$1.GET);
    // ----------------------------
    // FILTERS
    // ----------------------------
    router.post('/apply-filters', loadReportDefinition.loadReportDefinition(services), validateFilters.validateFilters({ interactive: true, loadType: UserReports.LoadType.SYNC }), controller$1.applyFilters);
    router.post('/reset-filters', controller$1.resetFilters);
    // ---------------------------
    // COLUMNS
    // ----------------------------
    router.post('/apply-columns', controller$1.applyColumns);
    router.post('/reset-columns', controller$1.resetColumns);
    // ----------------------------
    // User defined defaults
    // ----------------------------
    router.post('/save-defaults', controller$1.saveDefaultFilterValues);
    router.post('/remove-defaults', controller$1.removeDefaultFilterValues);
    return router;
}

exports.default = routes;
exports.routes = routes;
//# sourceMappingURL=routes.js.map
