LP1896083 Staff catalog handles not-found barcodes
authorBill Erickson <berickxx@gmail.com>
Thu, 17 Sep 2020 15:39:43 +0000 (11:39 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Tue, 22 Sep 2020 13:54:54 +0000 (09:54 -0400)
Staff catalog => Numeric Search => Item Barcode

Display the standard 'No Maching Items Were Found' message when a
barcode search returns no results.

Prior to this patch, the search progress indicator would freeze as the
page failed to completely render on JS error.

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 805a0bb..09268bf 100644 (file)
@@ -61,6 +61,8 @@ export class CatalogService {
             'open-ils.search.multi_home.bib_ids.by_barcode',
             ctx.identSearch.value
         ).toPromise().then(ids => {
+            // API returns an event for not-found barcodes
+            if (!Array.isArray(ids)) { ids = []; }
             const result = {
                 count: ids.length,
                 ids: ids.map(id => [id])