Skip to content

Commit

Permalink
manage no birthday given
Browse files Browse the repository at this point in the history
  • Loading branch information
maltaesousa committed Mar 31, 2021
1 parent f6277cb commit 715f7fb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions front/src/app/auth/register/register.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,10 @@ export class RegisterComponent implements OnInit, AfterViewInit {
}

get birthDay() {
return this.formAddress.get('birthDay');
if (this.formAddress.get('birthDay')?.value) {
return this.formAddress.get('birthDay')?.value.toISOString().slice(0, 10);
}
return null;
}

get password() {
Expand Down Expand Up @@ -165,7 +168,7 @@ export class RegisterComponent implements OnInit, AfterViewInit {
company_name: this.companyName?.value,
ide_id: this.ideId?.value,
phone: this.phone?.value,
birthday: this.birthDay?.value?.toISOString().slice(0,10),
birthday: this.birthDay,
};
this.apiService.register(user)
.subscribe(async (res) => {
Expand Down

0 comments on commit 715f7fb

Please sign in to comment.