From f84f8cd5337ea476c73a1620a41a85c08e188472 Mon Sep 17 00:00:00 2001 From: Jane Sandberg Date: Tue, 26 Mar 2019 15:46:48 -0700 Subject: [PATCH] change if/else into observable error handling --- .../src/app/staff/booking/manage-reservations.component.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 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 df7ba59bdb..2e149ee164 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 @@ -76,13 +76,11 @@ export class ManageReservationsComponent implements OnInit { {'barcode' : this.resourceBarcode}, {'limit': 1}) .pipe(single()) .subscribe((res) => { - if (res.id()) { - this.resourceId = res.id(); - this.reservationsGrid.reloadGrid(); - } else { - this.resourceId = -1; - this.toast.danger('No resource found with this barcode'); - } + this.resourceId = res.id(); + this.reservationsGrid.reloadGrid(); + }, (err) => { + this.resourceId = -1; + this.toast.danger('No resource found with this barcode'); }); } this.resourceTypeId = +params.get('resource_type_id'); -- 2.11.0