diff --git a/frontend/src/app/core/services/worker.service.ts b/frontend/src/app/core/services/worker.service.ts index b4d4ac7883..ba177217f6 100644 --- a/frontend/src/app/core/services/worker.service.ts +++ b/frontend/src/app/core/services/worker.service.ts @@ -32,6 +32,11 @@ interface TotalStaffRecordsResponse { total: number; } +export interface NewWorkerMandatoryInfo { + nameOrId: string; + contract: Contracts; +} + @Injectable({ providedIn: 'root', }) @@ -45,7 +50,7 @@ export class WorkerService { public worker$ = this._worker$.asObservable(); public getRoute$: BehaviorSubject = new BehaviorSubject(null); public createStaffResponse = null; - private _newWorkerMandatoryInfo: { nameOrId: string; contract: Contracts } = null; + private _newWorkerMandatoryInfo: NewWorkerMandatoryInfo = null; private _workers$: BehaviorSubject = new BehaviorSubject(null); public workers$: Observable = this._workers$.asObservable(); @@ -297,7 +302,7 @@ export class WorkerService { this._newWorkerMandatoryInfo = { nameOrId, contract }; } - public get newWorkerMandatoryInfo(): { nameOrId: string; contract: Contracts } { + public get newWorkerMandatoryInfo(): NewWorkerMandatoryInfo { return this._newWorkerMandatoryInfo; } diff --git a/frontend/src/app/features/workers/main-job-role/main-job-role.component.ts b/frontend/src/app/features/workers/main-job-role/main-job-role.component.ts index 68571868c5..8345f5fcfb 100644 --- a/frontend/src/app/features/workers/main-job-role/main-job-role.component.ts +++ b/frontend/src/app/features/workers/main-job-role/main-job-role.component.ts @@ -5,7 +5,7 @@ import { UntypedFormBuilder, Validators } from '@angular/forms'; import { ActivatedRoute, Router } from '@angular/router'; import { BackLinkService } from '@core/services/backLink.service'; import { ErrorSummaryService } from '@core/services/error-summary.service'; -import { WorkerService } from '@core/services/worker.service'; +import { NewWorkerMandatoryInfo, WorkerService } from '@core/services/worker.service'; import { EstablishmentService } from '@core/services/establishment.service'; import { Contracts } from '@core/model/contracts.enum'; import { AlertService } from '@core/services/alert.service'; @@ -24,10 +24,7 @@ export class MainJobRoleComponent extends QuestionComponent implements OnInit, O public summaryContinue: boolean; public callToActionLabel: string = 'Save and return'; private isAddingNewWorker: boolean; - private newWorkerMandantoryInfo: { - nameOrId: string; - contract: Contracts; - }; + private newWorkerMandantoryInfo: NewWorkerMandatoryInfo; private summaryText = { 'Care providing roles': 'care worker, community support, support worker',