UNPKG

@ministryofjustice/hmpps-digital-prison-reporting-frontend

Version:

The Digital Prison Reporting Frontend contains templates and code to help display data effectively in UI applications.

30 lines (25 loc) 888 B
'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