summaryrefslogtreecommitdiffstats
path: root/usecaseui-portal/src/app/views/management/management.component.ts
diff options
context:
space:
mode:
authorcyuamber <xuranyjy@chinamobile.com>2020-04-27 19:06:12 +0800
committercyuamber <xuranyjy@chinamobile.com>2020-04-27 19:06:18 +0800
commitc46bae2a8435ae6e27e242c0a158f4c99214461f (patch)
tree83f1b437b098eb5ba2d6e2128cb28d84de53c544 /usecaseui-portal/src/app/views/management/management.component.ts
parent5da70916a3eb0295daf5e715b3ee69aa082e41ad (diff)
fix: fix bugs of adding customers
Change-Id: I177fc3a15aa49beefc3ea5c372a2e60dc594c90d Issue-ID: USECASEUI-306 Signed-off-by: cyuamber <xuranyjy@chinamobile.com>
Diffstat (limited to 'usecaseui-portal/src/app/views/management/management.component.ts')
-rw-r--r--usecaseui-portal/src/app/views/management/management.component.ts77
1 files changed, 39 insertions, 38 deletions
diff --git a/usecaseui-portal/src/app/views/management/management.component.ts b/usecaseui-portal/src/app/views/management/management.component.ts
index b1a88e1e..727de636 100644
--- a/usecaseui-portal/src/app/views/management/management.component.ts
+++ b/usecaseui-portal/src/app/views/management/management.component.ts
@@ -13,50 +13,51 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
-import { Component, OnInit, HostBinding } from '@angular/core';
-import { showHideAnimate, slideToRight } from '../../shared/utils/animates';
-import { ManagemencsService } from '../../core/services/managemencs.service';
+import { Component, OnInit, HostBinding } from '@angular/core'
+import { showHideAnimate, slideToRight } from '../../shared/utils/animates'
+import { ManagemencsService } from '../../core/services/managemencs.service'
@Component({
- selector: 'app-management',
- templateUrl: './management.component.html',
- styleUrls: ['./management.component.less'],
- animations: [
- showHideAnimate, slideToRight
- ]
+ selector: 'app-management',
+ templateUrl: './management.component.html',
+ styleUrls: ['./management.component.less'],
+ animations: [showHideAnimate, slideToRight]
})
export class ManagementComponent implements OnInit {
- @HostBinding('@routerAnimate') routerAnimateState; //Routing animation
+ @HostBinding('@routerAnimate') routerAnimateState //Routing animation
- nocuster: boolean;
- firstCustomer: string;
+ nocuster: boolean
+ firstCustomer: string
- constructor(private managemencs: ManagemencsService) { }
+ constructor (private managemencs: ManagemencsService) {}
- ngOnInit() {
- this.getAllCustomers();
- }
-
- // Get all customers
- getAllCustomers() {
- this.managemencs.getAllCustomers().subscribe((data) => {
- this.nocuster = data.length > 0 ? false : true;
- })
- }
- createNewCustomer(customer) {
- let createParams = {
- customerId: customer
- };
- this.managemencs.createCustomer(customer, createParams).subscribe((data) => {
- if (data["status"] == 'SUCCESS') {
- this.nocuster = false;
- } else {
- this.nocuster = true;
- console.log(data, "Interface returned error")
- }
- })
- }
- clearCustomerInput() {
- this.firstCustomer = '';
+ ngOnInit () {
+ this.getAllCustomers()
+ }
+
+ // Get all customers
+ getAllCustomers () {
+ this.managemencs.getAllCustomers().subscribe(data => {
+ this.nocuster = data.length > 0 ? false : true
+ })
+ }
+ createNewCustomer (customer) {
+ let createParams = {
+ // customerId: customer,
+ 'global-customer-id': customer,
+ 'subscriber-name': customer,
+ 'subscriber-type': 'INFRA'
}
+ this.managemencs.createCustomer(customer, createParams).subscribe(data => {
+ if (data['status'] == 'SUCCESS') {
+ this.nocuster = false
+ } else {
+ this.nocuster = true
+ console.log(data, 'Interface returned error')
+ }
+ })
+ }
+ clearCustomerInput () {
+ this.firstCustomer = ''
+ }
}