Skip to content

Commit

Permalink
better response
Browse files Browse the repository at this point in the history
  • Loading branch information
mlapaglia committed Jul 21, 2021
1 parent 7ab84eb commit 434d6db
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class EnrichersService {
return this.http.post("/settings/enrichers", enricher);
}

public testEnricher(enricherId: string): Observable<any> {
return this.http.post(`/settings/enrichers/${enricherId}/test`, null)
public testEnricher(enricherId: string): Observable<boolean> {
return this.http.post<boolean>(`/settings/enrichers/${enricherId}/test`, null)
}
}

0 comments on commit 434d6db

Please sign in to comment.