gridSource: GridDataSource;
patronId: number;
resourceBarcode: string;
+ resourceId: number;
numRowsSelected: number;
@ViewChild('grid') grid: GridComponent;
orderBy.bresv = sort[0].name + ' ' + sort[0].dir;
}
return this.pcrud.search('bresv', {
- "usr" : (this.patronId ? this.patronId : {">" : 1}),
- "target_resource" : {"barcode" : (this.resourceBarcode ? this.resourceBarcode : {"!=" : null})}
+ "usr" : (this.patronId ? this.patronId : {">" : 0}),
+ "target_resource" : (this.resourceId ? this.resourceId : {">" : 0}),
}, {
order_by: orderBy,
limit: pager.limit,
}
this.editDialog.mode = 'update'; // this fmeditor is not used for creating objects, just updates
+
+ if (this.resourceBarcode) {
+ this.pcrud.search('brsrc', {'barcode' : this.resourceBarcode}, {"limit": 1, "select": ["id"]}).subscribe((res) => this.resourceId = res.id());
+ }
}
+
showEditDialog(idlThing: IdlObject) {
this.editDialog.recId = idlThing.id();
return this.editDialog.open({size: 'lg'}).then(