Refactored Test email service to provide the error message if it fails to the end user. (#1051)
This commit is contained in:
parent
9ce0aa39ce
commit
edbb985405
5 changed files with 50 additions and 21 deletions
|
@ -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() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue