cr-connect-bpmn/src/app/settings.service.ts
Dan c5149cee74 Adding a settings page to specify which study you want to use for validation.
Also improving the validation message display via the shared libraries.
Droping the protocol-builder component, as it wasn't in use.
2021-07-07 00:52:24 -04:00

25 lines
457 B
TypeScript

import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root'
})
export class SettingsService {
private studyIdKey = 'study_id';
constructor() { }
setStudyIdForValidation(id: number) {
localStorage.setItem(this.studyIdKey, id.toString());
}
getStudyIdForValidation() {
const value = localStorage.getItem(this.studyIdKey);
if (value) {
return parseInt(value, 10);
} else {
return null;
}
}
}