LP1881650 Staff catalog TCN includes delete records
authorBill Erickson <berickxx@gmail.com>
Mon, 1 Jun 2020 19:20:13 +0000 (15:20 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Tue, 9 Feb 2021 18:51:42 +0000 (13:51 -0500)
For consistency with the menu action Cataloging => Retrieve Record by
TCN Value, the staff catalog Numeric Search => TCN search now includes
deleted bib records.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Mary Llewellyn <mllewell@biblio.org>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/src/eg2/src/app/share/catalog/catalog.service.ts

index 09268bf..af996c2 100644 (file)
@@ -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<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> {