import localsHelper from '../../../../utils/localsHelper.js';

class BookmarkController {
    layoutPath;
    services;
    constructor(layoutPath, services) {
        this.layoutPath = layoutPath;
        this.services = services;
    }
    POST = async (req, res) => {
        const { dprUser } = localsHelper.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();
    };
}

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