} else if (ctx.identSearch.isSearchable() &&
ctx.identSearch.queryType === 'item_barcode') {
return this.barcodeSearch(ctx);
+ } else if (
+ ctx.isStaff &&
+ ctx.identSearch.isSearchable() &&
+ ctx.identSearch.queryType === 'identifier|tcn') {
+ return this.tcnStaffSearch(ctx);
} else {
return this.termSearch(ctx);
}
});
}
+ tcnStaffSearch(ctx: CatalogSearchContext): Promise<void> {
+ return this.net.request(
+ 'open-ils.search',
+ 'open-ils.search.biblio.tcn',
+ ctx.identSearch.value, 1
+ ).toPromise().then(result => {
+ result.ids = result.ids.map(id => [id]);
+ this.applyResultData(ctx, result);
+ ctx.searchState = CatalogSearchState.COMPLETE;
+ this.onSearchComplete.emit(ctx);
+ });
+ }
+
+
// "Search" the basket by loading the IDs and treating
// them like a standard query search results set.
basketSearch(ctx: CatalogSearchContext): Promise<void> {