From 434d6db66b23dcaa5b1a5f311cb2bcdc94a7e1ea Mon Sep 17 00:00:00 2001 From: mlapaglia Date: Tue, 20 Jul 2021 23:17:30 -0400 Subject: [PATCH] better response --- .../src/app/settings/enrichers/enrichers.component.ts | 10 ++++++++-- .../src/app/settings/enrichers/enrichers.service.ts | 4 ++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/OpenAlprWebhookProcessor/ClientApp/src/app/settings/enrichers/enrichers.component.ts b/OpenAlprWebhookProcessor/ClientApp/src/app/settings/enrichers/enrichers.component.ts index e88b3546..29832c6b 100644 --- a/OpenAlprWebhookProcessor/ClientApp/src/app/settings/enrichers/enrichers.component.ts +++ b/OpenAlprWebhookProcessor/ClientApp/src/app/settings/enrichers/enrichers.component.ts @@ -49,9 +49,15 @@ export class EnrichersComponent implements OnInit { public testEnricher() { this.isTesting = true; - this.enricherService.testEnricher(this.enricher.id).subscribe(_ => { + this.enricherService.testEnricher(this.enricher.id).subscribe(result => { this.isTesting = false; - this.snackbarService.create("Enricher test succeeded.", SnackBarType.Saved); + + if (result) { + this.snackbarService.create("Enricher test succeeded.", SnackBarType.Saved); + } + else { + this.snackbarService.create("Enricher test failed, check the logs.", SnackBarType.Error); + } }, _ => { this.isSaving = false; this.snackbarService.create("Enricher test failed, check the logs.", SnackBarType.Error); diff --git a/OpenAlprWebhookProcessor/ClientApp/src/app/settings/enrichers/enrichers.service.ts b/OpenAlprWebhookProcessor/ClientApp/src/app/settings/enrichers/enrichers.service.ts index 0edff67e..3827f10c 100644 --- a/OpenAlprWebhookProcessor/ClientApp/src/app/settings/enrichers/enrichers.service.ts +++ b/OpenAlprWebhookProcessor/ClientApp/src/app/settings/enrichers/enrichers.service.ts @@ -18,7 +18,7 @@ export class EnrichersService { return this.http.post("/settings/enrichers", enricher); } - public testEnricher(enricherId: string): Observable { - return this.http.post(`/settings/enrichers/${enricherId}/test`, null) + public testEnricher(enricherId: string): Observable { + return this.http.post(`/settings/enrichers/${enricherId}/test`, null) } }