From 251ce26db364e1d7468b43ca917dee648a9ad133 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 28 Sep 2022 15:15:41 +0200 Subject: Fix error display in bulk service --- .../src/app/shared/shared-search/find-in-bulk.service.ts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'client/src') diff --git a/client/src/app/shared/shared-search/find-in-bulk.service.ts b/client/src/app/shared/shared-search/find-in-bulk.service.ts index d2f8c3213..d6ee04379 100644 --- a/client/src/app/shared/shared-search/find-in-bulk.service.ts +++ b/client/src/app/shared/shared-search/find-in-bulk.service.ts @@ -80,13 +80,18 @@ export class FindInBulkService { map(result => result.response.data), map(data => data.find(finder)) ) - .subscribe(result => { - if (!result) { - obs.error(new Error($localize`Element ${param} not found`)) - } else { + .subscribe({ + next: result => { + if (!result) { + obs.error(new Error($localize`Element ${param} not found`)) + return + } + obs.next(result) obs.complete() - } + }, + + error: err => obs.error(err) }) observableObject.notifier.next(param) -- cgit v1.2.3