Update api routes name (plural nouns)
[src/xds/xds-agent.git] / webapp / src / app / services / xdsagent.service.ts
index e570399..2ea2d5d 100644 (file)
@@ -285,15 +285,15 @@ export class XDSAgentService {
     }
 
     addProject(cfg: IXDSProjectConfig): Observable<IXDSProjectConfig> {
-        return this._post('/project', cfg);
+        return this._post('/projects', cfg);
     }
 
     deleteProject(id: string): Observable<IXDSProjectConfig> {
-        return this._delete('/project/' + id);
+        return this._delete('/projects/' + id);
     }
 
     syncProject(id: string): Observable<string> {
-        return this._post('/project/sync/' + id, {});
+        return this._post('/projects/sync/' + id, {});
     }
 
     /***
@@ -305,7 +305,7 @@ export class XDSAgentService {
                 id: prjID,
                 rpath: dir,
                 cmd: cmd,
-                sdkid: sdkid || "",
+                sdkID: sdkid || "",
                 args: args || [],
                 env: env || [],
             });
@@ -317,7 +317,7 @@ export class XDSAgentService {
             {
                 id: prjID,
                 rpath: dir,
-                sdkid: sdkid,
+                sdkID: sdkid,
                 args: args || [],
                 env: env || [],
             });
@@ -382,7 +382,7 @@ export class XDSAgentService {
         if (err instanceof Response) {
             const body = err.json() || 'Agent error';
             e = body.error || JSON.stringify(body);
-            if (!e || e === "") {
+            if (!e || e === "" || e === '{"isTrusted":true}') {
                 e = `${err.status} - ${err.statusText || 'Unknown error'}`;
             }
         } else if (typeof err === "object") {