Refactored Test email service to provide the error message if it fails to the end user. (#1051)

This commit is contained in:
Joseph Milazzo 2022-02-09 07:14:51 -08:00 committed by GitHub
parent 9ce0aa39ce
commit edbb985405
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 50 additions and 21 deletions

View file

@ -1,9 +1,16 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { map } from 'rxjs/operators';
import { environment } from 'src/environments/environment';
import { ServerSettings } from './_models/server-settings';
/**
* Used only for the Test Email Service call
*/
export interface EmailTestResult {
successful: boolean;
errorMessage: string;
}
@Injectable({
providedIn: 'root'
})
@ -30,7 +37,7 @@ export class SettingsService {
}
testEmailServerSettings(emailUrl: string) {
return this.http.post<boolean>(this.baseUrl + 'settings/test-email-url', {url: emailUrl}, {responseType: 'text' as 'json'});
return this.http.post<EmailTestResult>(this.baseUrl + 'settings/test-email-url', {url: emailUrl});
}
getTaskFrequencies() {