From: Galen Charlton Date: Wed, 25 Mar 2020 14:54:47 +0000 (-0400) Subject: update provider contacts component to reflect updates in provider record service X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=61d1ed41b224de4301d0396efcc4d4147a619cad;p=working%2FEvergreen.git update provider contacts component to reflect updates in provider record service Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/src/eg2/src/app/staff/acq/provider/provider-contacts.component.ts b/Open-ILS/src/eg2/src/app/staff/acq/provider/provider-contacts.component.ts index e42e3a7537..238bafeb0a 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/provider/provider-contacts.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/acq/provider/provider-contacts.component.ts @@ -10,7 +10,6 @@ import {GridComponent} from '@eg/share/grid/grid.component'; import {GridDataSource, GridCellTextGenerator} from '@eg/share/grid/grid'; import {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'; @@ -54,7 +53,6 @@ export class ProviderContactsComponent implements OnInit, AfterViewInit { private auth: AuthService, private idl: IdlService, private providerRecord: ProviderRecordService, - private pcrud: PcrudService, private toast: ToastService) { } @@ -64,7 +62,7 @@ export class ProviderContactsComponent 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() @@ -74,7 +72,11 @@ export class ProviderContactsComponent implements OnInit, AfterViewInit { this.deleteFailedString.current() .then(str => this.toast.danger(str)); }, - () => this.providerContactsGrid.reload() + () => { + this.providerRecord.refreshCurrent().then( + () => this.providerContactsGrid.reload() + ); + } ); }; this.providerContactsGrid.onRowActivate.subscribe( @@ -125,7 +127,9 @@ export class ProviderContactsComponent implements OnInit, AfterViewInit { result => { this.successString.current() .then(str => this.toast.success(str)); - this.providerContactsGrid.reload(); + this.providerRecord.refreshCurrent().then( + () => this.providerContactsGrid.reload() + ); resolve(result); }, error => { @@ -159,7 +163,9 @@ export class ProviderContactsComponent implements OnInit, AfterViewInit { ok => { this.createString.current() .then(str => this.toast.success(str)); - this.providerContactsGrid.reload(); + this.providerRecord.refreshCurrent().then( + () => this.providerContactsGrid.reload() + ); }, rejection => { if (!rejection.dismissed) {