@ministryofjustice/hmpps-digital-prison-reporting-frontend
Version:
The Digital Prison Reporting Frontend contains templates and code to help display data effectively in UI applications.
25 lines (22 loc) • 773 B
JavaScript
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