{'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');