From dd188597e6e1f8f5d244ac4cd71f0b4a784ff302 Mon Sep 17 00:00:00 2001 From: Jane Sandberg Date: Tue, 26 Mar 2019 16:13:12 -0700 Subject: [PATCH] make sure to reload grids after inputs change --- .../src/app/staff/booking/manage-reservations.component.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/staff/booking/manage-reservations.component.ts b/Open-ILS/src/eg2/src/app/staff/booking/manage-reservations.component.ts index 2e149ee164..3e00b89b0c 100644 --- a/Open-ILS/src/eg2/src/app/staff/booking/manage-reservations.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/booking/manage-reservations.component.ts @@ -58,6 +58,9 @@ export class ManageReservationsComponent implements OnInit { ngOnInit() { this.route.paramMap.subscribe((params: ParamMap) => { this.patronId = +params.get('patron_id'); + this.resourceBarcode = params.get('resource_barcode'); + this.resourceTypeId = +params.get('resource_type_id'); + if (this.patronId) { this.pcrud.search('au', { 'id': this.patronId, @@ -66,12 +69,12 @@ export class ManageReservationsComponent implements OnInit { flesh: 1, flesh_fields: {'au': ['card']} }).subscribe( - (resp) => { this.patronBarcode = resp.card().barcode(); }, + (resp) => { + this.reservationsGrid.reloadGrid(); + this.patronBarcode = resp.card().barcode(); }, (err) => { console.log(err); } ); - } - this.resourceBarcode = params.get('resource_barcode'); - if (this.resourceBarcode) { + } else if (this.resourceBarcode) { this.pcrud.search('brsrc', {'barcode' : this.resourceBarcode}, {'limit': 1}) .pipe(single()) @@ -82,8 +85,9 @@ export class ManageReservationsComponent implements OnInit { this.resourceId = -1; this.toast.danger('No resource found with this barcode'); }); + } else if (this.resourceTypeId) { + this.reservationsGrid.reloadGrid(); } - this.resourceTypeId = +params.get('resource_type_id'); this.chooseAppropriateFilter(); }); -- 2.11.0