@hmcts/ccd-case-ui-toolkit 7.3.49-tmp2 → 7.3.49-user-by-idam-testrev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8849,10 +8849,10 @@ class CaseworkerService {
8849
8849
  this.appConfig = appConfig;
8850
8850
  this.errorService = errorService;
8851
8851
  }
8852
- getCaseworkers(serviceId) {
8853
- const url = `${this.appConfig.getWorkAllocationApiUrl()}/caseworker/getUsersByServiceName`;
8852
+ getUserByIdamId(idamId) {
8853
+ const url = `${this.appConfig.getWorkAllocationApiUrl()}/caseworker/getUserByIdamId`;
8854
8854
  return this.http
8855
- .post(url, { services: [serviceId] })
8855
+ .post(url, idamId)
8856
8856
  .pipe(catchError(error => {
8857
8857
  this.errorService.setError(error);
8858
8858
  return throwError(error);
@@ -12351,12 +12351,9 @@ class CaseEventCompletionTaskReassignedComponent {
12351
12351
  this.jurisdiction = task.jurisdiction;
12352
12352
  this.caseType = task.case_type_id;
12353
12353
  // Current user is a caseworker?
12354
- this.caseworkerSubscription = this.caseworkerService.getCaseworkers(task.jurisdiction).subscribe(result => {
12355
- if (result && result[0].service === task.jurisdiction && result[0].caseworkers) {
12356
- const caseworker = result[0].caseworkers.find(x => x.idamId === task.assignee);
12357
- if (caseworker) {
12358
- this.assignedUserName = `${caseworker.firstName} ${caseworker.lastName}`;
12359
- }
12354
+ this.caseworkerSubscription = this.caseworkerService.getUserByIdamId(task.assignee).subscribe(caseworker => {
12355
+ if (caseworker) {
12356
+ this.assignedUserName = `${caseworker.firstName} ${caseworker.lastName}`;
12360
12357
  }
12361
12358
  if (!this.assignedUserName) {
12362
12359
  // Current user is a judicial user?
@@ -37379,12 +37376,9 @@ class TaskAssignedComponent {
37379
37376
  // Current user is a caseworker?
37380
37377
  this.jurisdiction = this.task.jurisdiction;
37381
37378
  this.caseType = this.task.case_type_id;
37382
- this.caseworkerSubscription = this.caseworkerService.getCaseworkers(this.task.jurisdiction).subscribe(result => {
37383
- if (result && result[0].service === this.task.jurisdiction && result[0].caseworkers) {
37384
- const caseworker = result[0].caseworkers.find(x => x.idamId === this.task.assignee);
37385
- if (caseworker) {
37386
- this.assignedUserName = `${caseworker.firstName} ${caseworker.lastName}`;
37387
- }
37379
+ this.caseworkerSubscription = this.caseworkerService.getUserByIdamId(this.task.assignee).subscribe(caseworker => {
37380
+ if (caseworker) {
37381
+ this.assignedUserName = `${caseworker.firstName} ${caseworker.lastName}`;
37388
37382
  }
37389
37383
  if (!this.assignedUserName) {
37390
37384
  // Current user is a judicial user?