'use strict';

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

var localsHelper = require('../../../../utils/localsHelper.js');

class BookmarkController {
    layoutPath;
    services;
    constructor(layoutPath, services) {
        this.layoutPath = layoutPath;
        this.services = services;
    }
    POST = async (req, res) => {
        const { dprUser } = localsHelper.default.getValues(res);
        const { reportId, id, reportType, type } = req.body;
        if (type === 'add') {
            await this.services.bookmarkService.addBookmark(dprUser.id, reportId, id, reportType);
        }
        else {
            await this.services.bookmarkService.removeBookmark(dprUser.id, id, reportId);
        }
        res.end();
    };
}

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