From 098b93f8378db1d9c0b5ee73383cf790c6bd6d63 Mon Sep 17 00:00:00 2001 From: piratefinn Date: Mon, 4 Sep 2017 17:26:01 +0100 Subject: [PATCH] Fixed account updating and display name for org --- src/app/dashboard/account-edit.component.html | 31 +++++++++++++++++++ src/app/dashboard/account-edit.component.ts | 5 ++- src/app/dashboard/feedback.component.ts | 2 +- src/app/providers/api-service.ts | 2 +- 4 files changed, 37 insertions(+), 3 deletions(-) diff --git a/src/app/dashboard/account-edit.component.html b/src/app/dashboard/account-edit.component.html index 87937be..f46aca7 100644 --- a/src/app/dashboard/account-edit.component.html +++ b/src/app/dashboard/account-edit.component.html @@ -73,6 +73,37 @@ +
+
+ +
+ + Alter this if your business sector has changed. +
+
+
diff --git a/src/app/dashboard/account-edit.component.ts b/src/app/dashboard/account-edit.component.ts index a537b3a..707b93c 100644 --- a/src/app/dashboard/account-edit.component.ts +++ b/src/app/dashboard/account-edit.component.ts @@ -31,6 +31,7 @@ export class AccountEditComponent implements OnInit { name : ['', [Validators.required]], street_name : ['', [Validators.required]], town : ['', [Validators.required]], + sector : ['', [Validators.required]], }); this.settingCustomerForm = this.formBuilder.group({ full_name : ['', [Validators.required]], @@ -53,12 +54,13 @@ export class AccountEditComponent implements OnInit { name: result.name, street_name: result.street_name, town: result.town, + sector: result.sector, }); this.settingCustomerForm.patchValue({ full_name: result.full_name, display_name: result.display_name, }); - this.api.setUserInfo( result.email, result.display_name ); + this.api.setUserInfo( result.email, result.display_name || result.name ); }, error => { console.log( error._body ); @@ -95,6 +97,7 @@ export class AccountEditComponent implements OnInit { name: settingOrganisationForm.name, street_name: settingOrganisationForm.street_name, town: settingOrganisationForm.town, + sector: settingOrganisationForm.sector, }; // data.append('form', JSON.stringify(submitData)); diff --git a/src/app/dashboard/feedback.component.ts b/src/app/dashboard/feedback.component.ts index e5d6502..f1f1f93 100644 --- a/src/app/dashboard/feedback.component.ts +++ b/src/app/dashboard/feedback.component.ts @@ -41,7 +41,7 @@ export class FeedbackComponent { this.feedbackForm.patchValue({ email: result.email, }); - this.api.setUserInfo( result.email, result.display_name ); + this.api.setUserInfo( result.email, result.display_name || result.name ); }, error => { console.log( error._body ); diff --git a/src/app/providers/api-service.ts b/src/app/providers/api-service.ts index 17da0c8..a171f1b 100644 --- a/src/app/providers/api-service.ts +++ b/src/app/providers/api-service.ts @@ -64,7 +64,7 @@ export class ApiService { this.setSessionKey(result.session_key); this.setUserInfo( result.email, - result.display_name + result.display_name || result.name ); this.setUserType(result.user_type) }