From 8236e0358e9c550f67956e2679938c99812e3b0d Mon Sep 17 00:00:00 2001 From: pengpengshui Date: Tue, 18 Jul 2017 09:50:04 -0700 Subject: [PATCH] fix #2775 about create-rule modal connect test issue --- src/ui_ng/lib/src/service/endpoint.service.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ui_ng/lib/src/service/endpoint.service.ts b/src/ui_ng/lib/src/service/endpoint.service.ts index 1ef0a8bab..66d797349 100644 --- a/src/ui_ng/lib/src/service/endpoint.service.ts +++ b/src/ui_ng/lib/src/service/endpoint.service.ts @@ -36,7 +36,7 @@ export abstract class EndpointService { * @abstract * @param {(number | string)} endpointId * @returns {(Observable | Endpoint)} - * + * * @memberOf EndpointService */ abstract getEndpoint(endpointId: number | string): Observable | Promise | Endpoint; @@ -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()