X-Git-Url: https://git.evergreen-ils.org/?p=Evergreen.git;a=blobdiff_plain;f=Open-ILS%2Fsrc%2Feg2%2Fsrc%2Fapp%2Fshare%2Fcatalog%2Fcatalog.service.ts;h=af996c23838fe089e1b52f7e224a3ec3b86ab7a9;hp=09268bf761cd2c342ff866b0be17e27fec6c8e46;hb=730f0f4f18238654221c17a289643c896cd7ffa9;hpb=46131551c0bd8603e10fc76364e5e77c3a0fcb02 diff --git a/Open-ILS/src/eg2/src/app/share/catalog/catalog.service.ts b/Open-ILS/src/eg2/src/app/share/catalog/catalog.service.ts index 09268bf761..af996c2383 100644 --- a/Open-ILS/src/eg2/src/app/share/catalog/catalog.service.ts +++ b/Open-ILS/src/eg2/src/app/share/catalog/catalog.service.ts @@ -50,6 +50,11 @@ export class CatalogService { } 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); } @@ -74,6 +79,20 @@ export class CatalogService { }); } + tcnStaffSearch(ctx: CatalogSearchContext): Promise { + 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 {