From 6bb3c7ec487b5a6ff13bfdb3d462d9c42c33fcae Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Wed, 25 Mar 2020 10:38:59 -0400 Subject: [PATCH] update provider address component to reflect updates to provider record service Signed-off-by: Galen Charlton --- .../staff/acq/provider/provider-addresses.component.ts | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/staff/acq/provider/provider-addresses.component.ts b/Open-ILS/src/eg2/src/app/staff/acq/provider/provider-addresses.component.ts index 27dd4117a9..ece3ecb783 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/provider/provider-addresses.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/acq/provider/provider-addresses.component.ts @@ -10,7 +10,6 @@ import {GridComponent} from '@eg/share/grid/grid.component'; import {GridDataSource, GridCellTextGenerator} from '@eg/share/grid/grid'; import {ProviderRecord, ProviderRecordService} from './provider-record.service'; import {AcqProviderSearchFormComponent} from './acq-provider-search-form.component'; -import {PcrudService} from '@eg/core/pcrud.service'; import {FmRecordEditorComponent} from '@eg/share/fm-editor/fm-editor.component'; import {StringComponent} from '@eg/share/string/string.component'; import {ToastService} from '@eg/share/toast/toast.service'; @@ -52,7 +51,6 @@ export class ProviderAddressesComponent implements OnInit, AfterViewInit { private idl: IdlService, private auth: AuthService, private providerRecord: ProviderRecordService, - private pcrud: PcrudService, private toast: ToastService) { } @@ -61,7 +59,7 @@ export class ProviderAddressesComponent implements OnInit, AfterViewInit { this.cellTextGenerator = {}; this.deleteSelected = (idlThings: IdlObject[]) => { idlThings.forEach(idlThing => idlThing.isdeleted(true)); - this.pcrud.autoApply(idlThings).subscribe( + this.providerRecord.batchUpdate(idlThings).subscribe( val => { console.debug('deleted: ' + val); this.deleteSuccessString.current() @@ -71,7 +69,11 @@ export class ProviderAddressesComponent implements OnInit, AfterViewInit { this.deleteFailedString.current() .then(str => this.toast.danger(str)); }, - () => this.providerAddressesGrid.reload() + () => { + this.providerRecord.refreshCurrent().then( + () => this.providerAddressesGrid.reload() + ); + } ); }; this.providerAddressesGrid.onRowActivate.subscribe( @@ -122,7 +124,9 @@ export class ProviderAddressesComponent implements OnInit, AfterViewInit { result => { this.successString.current() .then(str => this.toast.success(str)); - this.providerAddressesGrid.reload(); + this.providerRecord.refreshCurrent().then( + () => this.providerAddressesGrid.reload() + ); resolve(result); }, error => { @@ -156,7 +160,9 @@ export class ProviderAddressesComponent implements OnInit, AfterViewInit { ok => { this.createString.current() .then(str => this.toast.success(str)); - this.providerAddressesGrid.reload(); + this.providerRecord.refreshCurrent().then( + () => this.providerAddressesGrid.reload() + ); }, rejection => { if (!rejection.dismissed) { -- 2.11.0