|
|
|
|
@ -27,8 +27,8 @@ export class ConnectorService {
|
|
|
|
|
public static retryTimes = 0;
|
|
|
|
|
public static timeOut = 120 * 1000;
|
|
|
|
|
|
|
|
|
|
// public static host = 'https://uat.hmgwebservices.com/';
|
|
|
|
|
public static host = 'https://hmgwebservices.com/';
|
|
|
|
|
public static host = 'https://uat.hmgwebservices.com/';
|
|
|
|
|
// public static host = 'https://hmgwebservices.com/';
|
|
|
|
|
|
|
|
|
|
constructor(public httpClient: HttpClient,
|
|
|
|
|
public cs: CommonService,
|
|
|
|
|
@ -39,7 +39,8 @@ export class ConnectorService {
|
|
|
|
|
service: string,
|
|
|
|
|
data: any,
|
|
|
|
|
onError: any,
|
|
|
|
|
errorLabel?: string
|
|
|
|
|
errorLabel?: string,
|
|
|
|
|
fromSMS = false
|
|
|
|
|
): Observable<any> {
|
|
|
|
|
this.cs.startLoading();
|
|
|
|
|
return this.httpClient
|
|
|
|
|
@ -52,7 +53,7 @@ export class ConnectorService {
|
|
|
|
|
timeout(ConnectorService.timeOut),
|
|
|
|
|
retry(ConnectorService.retryTimes),
|
|
|
|
|
tap(
|
|
|
|
|
res => this.handleResponse(res, onError, errorLabel),
|
|
|
|
|
res => this.handleResponse(res, onError, errorLabel, false, fromSMS),
|
|
|
|
|
error => this.handleError(error, onError, errorLabel)
|
|
|
|
|
)
|
|
|
|
|
);
|
|
|
|
|
@ -218,7 +219,8 @@ export class ConnectorService {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public handleResponse(result: Response, onError: any, errorLabel: string, isPostNoLoad = false) {
|
|
|
|
|
public handleResponse(result: Response, onError: any, errorLabel: string, isPostNoLoad = false, fromSMS = false) {
|
|
|
|
|
console.log('fromSMSValue ' + fromSMS)
|
|
|
|
|
if (!isPostNoLoad) {
|
|
|
|
|
this.cs.stopLoading();
|
|
|
|
|
}
|
|
|
|
|
@ -236,11 +238,16 @@ export class ConnectorService {
|
|
|
|
|
this.cs.stopLoading();
|
|
|
|
|
} else {
|
|
|
|
|
this.cs.stopLoading();
|
|
|
|
|
this.cs.showErrorMessageDialog(
|
|
|
|
|
onError,
|
|
|
|
|
errorLabel,
|
|
|
|
|
result.ErrorEndUserMessage
|
|
|
|
|
);
|
|
|
|
|
if (!fromSMS) {
|
|
|
|
|
this.cs.showErrorMessageDialog(
|
|
|
|
|
onError,
|
|
|
|
|
errorLabel,
|
|
|
|
|
result.ErrorEndUserMessage
|
|
|
|
|
);
|
|
|
|
|
} else {
|
|
|
|
|
console.log('its an error from sms')
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//add flag if user not auth
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|