fix #2775 about create-rule modal connect test issue

This commit is contained in:
pengpengshui 2017-07-18 09:50:04 -07:00
parent a9a79736b4
commit 8236e0358e

View File

@ -185,14 +185,16 @@ export class EndpointDefaultService extends EndpointService {
if(!endpoint) {
return Promise.reject('Invalid endpoint.');
}
let requestUrl: string = `${this._endpointUrl}/ping`;
let requestUrl: string ;
if(endpoint.id) {
requestUrl = `${this._endpointUrl}/${endpoint.id}/ping`;
return this.http
.post(requestUrl, {})
.toPromise()
.then(response=>response.status)
.catch(error=>Promise.reject(error));
} else {
requestUrl = `${this._endpointUrl}/ping`;
return this.http
.post(requestUrl, endpoint)
.toPromise()