From 966be352ca890b0322b3f404264b9ca8a8461eb0 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Thu, 17 Sep 2020 11:39:43 -0400 Subject: [PATCH] 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 Signed-off-by: Mary Llewellyn Signed-off-by: Galen Charlton --- Open-ILS/src/eg2/src/app/share/catalog/catalog.service.ts | 2 ++ 1 file changed, 2 insertions(+) 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]) -- 2.43.2