Refactor create account component onInit function.
This commit is contained in:
parent
aa8d9c5c73
commit
e541a155ff
@ -38,6 +38,22 @@ export class CreateAccountComponent implements OnInit {
|
||||
referrer: ['', Validators.required],
|
||||
businessCategory: ['', Validators.required],
|
||||
});
|
||||
this.loadSearchData();
|
||||
}
|
||||
|
||||
get createFormStub(): any {
|
||||
return this.createForm.controls;
|
||||
}
|
||||
|
||||
onSubmit(): void {
|
||||
this.submitted = true;
|
||||
if (this.createForm.invalid || !confirm('Create account?')) {
|
||||
return;
|
||||
}
|
||||
this.submitted = false;
|
||||
}
|
||||
|
||||
loadSearchData(): void {
|
||||
this.userService.getCategories();
|
||||
this.userService.categoriesSubject.subscribe((res) => {
|
||||
this.categories = Object.keys(res);
|
||||
@ -55,16 +71,4 @@ export class CreateAccountComponent implements OnInit {
|
||||
.pipe(first())
|
||||
.subscribe((res) => (this.genders = res));
|
||||
}
|
||||
|
||||
get createFormStub(): any {
|
||||
return this.createForm.controls;
|
||||
}
|
||||
|
||||
onSubmit(): void {
|
||||
this.submitted = true;
|
||||
if (this.createForm.invalid || !confirm('Create account?')) {
|
||||
return;
|
||||
}
|
||||
this.submitted = false;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user