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,
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())
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();
});