@ministryofjustice/hmpps-digital-prison-reporting-frontend
Version:
The Digital Prison Reporting Frontend contains templates and code to help display data effectively in UI applications.
35 lines (31 loc) • 1.13 kB
JavaScript
;
Object.defineProperty(exports, '__esModule', { value: true });
class ReportStoreService {
reportDataStore;
reportStore;
constructor(reportDataStore) {
this.reportDataStore = reportDataStore;
this.reportStore = reportDataStore;
}
async getState(userId) {
return this.reportStore.getUserConfig(userId);
}
async saveState(userId, userConfig) {
await this.reportStore.setUserConfig(userId, userConfig);
}
findIndexByExecutionId(executionId, array) {
return array.findIndex(report => report.executionId === executionId);
}
findIndexByTableId(tableId, array) {
return array.findIndex(report => report.tableId === tableId);
}
findIndexByReportId(id, array) {
return array.findIndex(report => report.id === id);
}
findIndexByReportAndVariantId(id, reportId, array) {
return array.findIndex(report => report.id === id && report.reportId === reportId);
}
}
exports.ReportStoreService = ReportStoreService;
exports.default = ReportStoreService;
//# sourceMappingURL=reportStoreService.js.map