import AsyncRequestListUtils from '../../../../../components/user-reports/requested/utils.js';
import UserReportsListUtils from '../../../../../components/user-reports/utils.js';
import localsHelper from '../../../../../utils/localsHelper.js';

class RequestedReportsListController {
    layoutPath;
    services;
    constructor(layoutPath, services) {
        this.layoutPath = layoutPath;
        this.services = services;
    }
    GET = async (_req, res) => {
        const { requestedReports } = localsHelper.getValues(res);
        const listParams = await UserReportsListUtils.renderList({
            reportsData: requestedReports,
            filterFunction: AsyncRequestListUtils.filterReports,
            res,
            type: 'requested',
        });
        res.render(`dpr/routes/journeys/my-reports/view`, {
            title: 'Requested reports',
            id: 'requested-reports-list',
            layoutPath: this.layoutPath,
            ...listParams,
        });
    };
}

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