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.

22 lines (21 loc) 707 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); class ReportStoreService { 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(id, array) { return array.findIndex((report) => report.executionId === id); } findIndexByTableId(id, array) { return array.findIndex((report) => report.tableId === id); } } exports.default = ReportStoreService;