fix e2e service instantiation bugs 70/72370/1
authorguochuyicmri <guochuyi@chinamobile.com>
Sat, 10 Nov 2018 14:58:58 +0000 (22:58 +0800)
committerguochuyicmri <guochuyi@chinamobile.com>
Sat, 10 Nov 2018 14:59:25 +0000 (22:59 +0800)
Change-Id: If2e4c3e883f0b8dbd0d54f94af3d1c00cc67463e
Issue-ID: USECASEUI-179
Signed-off-by: guochuyicmri <guochuyi@chinamobile.com>
usecaseui-portal/src/app/myhttp.service.ts
usecaseui-portal/src/app/services/services-list/services-list.component.ts

index 0496eed..7c77e97 100644 (file)
@@ -174,7 +174,7 @@ export class MyhttpService {
   // Create interface
   createInstance(requestBody, createParams) {
     // return this.http.get<any>(this.url.createService + createParams);  //Local simulation
-    return this.http.post<any>(this.url.createService, requestBody);
+    return this.http.post<any>(this.url.createService + createParams, requestBody);
   }
   nsCreateInstance(requestBody) {
     // return this.http.get<any>(this.url.ns_createService);  //Local simulation
index cc69e51..0509e70 100644 (file)
@@ -44,6 +44,10 @@ export class ServicesListComponent implements OnInit {
     this.myhttp.getAllCustomers()
       .subscribe((data)=>{
         this.customerList = data.map((item)=>{return {name:item["subscriber-name"],id:item["global-customer-id"]}});
+        if(this.customerList.length==0){
+          console.log("customerList.length == 0",this.customerList);
+          return false;
+        }
         this.customerSelected = this.customerList[0];
         this.choseCustomer(this.customerSelected);
         // console.log(this.customers)
@@ -55,6 +59,10 @@ export class ServicesListComponent implements OnInit {
     this.myhttp.getServiceTypes(this.customerSelected)
       .subscribe((data)=>{
         this.serviceTypeList = data.map((item)=>{return {name:item["service-type"]}});
+        if(this.serviceTypeList.length==0){
+          console.log("serviceTypeList.length == 0",this.serviceTypeList);
+          return false;
+        }
         this.serviceTypeSelected = this.serviceTypeList[0];
         this.choseServiceType(this.serviceTypeSelected);
         // console.log(this.listServiceTypes);