Fix linter errors on account-edit

This commit is contained in:
Tom Bloor 2017-08-24 16:20:55 +01:00
parent 346ea2c6fd
commit c46e91e795

View file

@ -8,7 +8,7 @@ import 'rxjs/add/operator/map';
templateUrl: 'account-edit.component.html',
providers: [ApiService]
})
export class AccountEditComponent {
export class AccountEditComponent implements OnInit {
settingForm: FormGroup;
settingOrganisationForm: FormGroup;
settingCustomerForm: FormGroup;
@ -69,23 +69,23 @@ export class AccountEditComponent {
onSubmitOrganisation() {
console.log(this.settingForm.valid);
if (!this.settingForm.valid && !this.settingOrganisationForm.valid) {
console.log("Not Valid!");
console.log('Not Valid!');
return;
}
let settingForm = this.settingForm.value;
let settingOrganisationForm = this.settingOrganisationForm.value;
const settingForm = this.settingForm.value;
const settingOrganisationForm = this.settingOrganisationForm.value;
// image upload code
let fi = this.fileInput.nativeElement;
let data = new FormData();
const fi = this.fileInput.nativeElement;
const data = new FormData();
if (fi.files && fi.files[0]) {
let fileToUpload = fi.files[0];
data.append("file", fileToUpload);
const fileToUpload = fi.files[0];
data.append('file', fileToUpload);
}
let submitData = {
const submitData = {
email: settingForm.email,
postcode: settingForm.postcode,
password: settingForm.password,
@ -93,7 +93,7 @@ export class AccountEditComponent {
name: settingOrganisationForm.name,
street_name: settingOrganisationForm.street_name,
town: settingOrganisationForm.town,
}
};
data.append('form', JSON.stringify(submitData));
@ -113,30 +113,30 @@ export class AccountEditComponent {
onSubmitCustomer() {
console.log(this.settingForm.valid);
if (!this.settingForm.valid && !this.settingCustomerForm.valid) {
console.log("Not Valid!");
console.log('Not Valid!');
return;
}
let settingForm = this.settingForm.value;
let settingCustomerForm = this.settingCustomerForm.value;
const settingForm = this.settingForm.value;
const settingCustomerForm = this.settingCustomerForm.value;
// image upload code
let fi = this.fileInput.nativeElement;
let data = new FormData();
const fi = this.fileInput.nativeElement;
const data = new FormData();
if (fi.files && fi.files[0]) {
let fileToUpload = fi.files[0];
data.append("file", fileToUpload);
const fileToUpload = fi.files[0];
data.append('file', fileToUpload);
}
let submitData = {
const submitData = {
email: settingForm.email,
postcode: settingForm.postcode,
password: settingForm.password,
new_password: settingForm.new_password,
full_name: settingCustomerForm.full_name,
display_name: settingCustomerForm.display_name,
}
};
data.append('form', JSON.stringify(submitData));