Skip to content
Snippets Groups Projects
Commit 8fc51ef5 authored by Alex ORLUC's avatar Alex ORLUC
Browse files

FEAT #13998 TIME 0:10 filter issuing site input by user primary entity

parent 53106d02
No related branches found
No related tags found
No related merge requests found
...@@ -4,6 +4,7 @@ import { FormControl } from '@angular/forms'; ...@@ -4,6 +4,7 @@ import { FormControl } from '@angular/forms';
import { tap, catchError, finalize } from 'rxjs/operators'; import { tap, catchError, finalize } from 'rxjs/operators';
import { of } from 'rxjs/internal/observable/of'; import { of } from 'rxjs/internal/observable/of';
import { NotificationService } from '../../../../../service/notification/notification.service'; import { NotificationService } from '../../../../../service/notification/notification.service';
import { HeaderService } from '../../../../../service/header.service';
@Component({ @Component({
selector: 'app-issuing-site-input', selector: 'app-issuing-site-input',
...@@ -36,6 +37,7 @@ export class IssuingSiteInputComponent implements OnInit { ...@@ -36,6 +37,7 @@ export class IssuingSiteInputComponent implements OnInit {
constructor( constructor(
public http: HttpClient, public http: HttpClient,
private notify: NotificationService, private notify: NotificationService,
private headerService: HeaderService
) { ) {
} }
...@@ -52,11 +54,11 @@ export class IssuingSiteInputComponent implements OnInit { ...@@ -52,11 +54,11 @@ export class IssuingSiteInputComponent implements OnInit {
this.http.get(`../rest/registeredMail/ranges`).pipe( this.http.get(`../rest/registeredMail/ranges`).pipe(
tap((data: any) => { tap((data: any) => {
this.issuingSiteAddress = null; this.issuingSiteAddress = null;
this.issuingSiteList = data['ranges'].filter((item: any) => item.registeredMailType === registeredMailType && item.status === 'OK').map((item: any) => { this.issuingSiteList = data['ranges'].filter((item: any) => item.registeredMailType === registeredMailType && item.status === 'OK' && item.entities.indexOf(this.headerService.user.entities[0].id) > -1).map((item: any) => {
return { return {
...item, ...item,
id : `${item.trackerNumber}#${item.siteId}`, id : `${item.trackerNumber}#${item.siteId}`,
label: `${item.siteLabel} (${item.customerAccountNumber})`, label: `${item.label} (${item.customerAccountNumber})`,
disabled: item.fullness === 100, disabled: item.fullness === 100,
}; };
}); });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment