'use strict';

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

var utils$1 = require('../../../../../components/user-reports/viewed/utils.js');
var utils = require('../../../../../components/user-reports/utils.js');
var localsHelper = require('../../../../../utils/localsHelper.js');

class RecentlyViewedReportsListController {
    layoutPath;
    services;
    constructor(layoutPath, services) {
        this.layoutPath = layoutPath;
        this.services = services;
    }
    GET = async (_req, res) => {
        const { recentlyViewedReports } = localsHelper.default.getValues(res);
        const listParams = await utils.default.renderList({
            reportsData: recentlyViewedReports,
            filterFunction: utils$1.default.filterReports,
            res,
            type: 'viewed',
        });
        res.render(`dpr/routes/journeys/my-reports/view`, {
            title: 'Recently viewed reports',
            id: 'recently-viewed-reports-list',
            layoutPath: this.layoutPath,
            ...listParams,
        });
    };
}

exports.RecentlyViewedReportsListController = RecentlyViewedReportsListController;
exports.default = RecentlyViewedReportsListController;
//# sourceMappingURL=controller.js.map
