From: Bill Erickson Date: Thu, 17 Sep 2020 15:39:43 +0000 (-0400) Subject: LP1896083 Staff catalog handles not-found barcodes X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=refs%2Fheads%2Fuser%2Fberick%2Flp1896083-staffcat-barcode-search-sanity;p=working%2FEvergreen.git LP1896083 Staff catalog handles not-found barcodes 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 --- 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 805a0bb589..09268bf761 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 @@ -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])