From ff6808ffdb2773055e9930e3a1686a39434fe55f Mon Sep 17 00:00:00 2001 From: florimondmanca <florimond.manca@gmail.com> Date: Thu, 20 Sep 2018 10:05:52 +0200 Subject: [PATCH] add phone on user and student registration --- src/app/signup/core/registration.model.ts | 2 ++ .../student-signup/student-signup.component.html | 11 ++++++++++- .../signup/student-signup/student-signup.component.ts | 1 + 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/app/signup/core/registration.model.ts b/src/app/signup/core/registration.model.ts index 23942bc..66ec066 100644 --- a/src/app/signup/core/registration.model.ts +++ b/src/app/signup/core/registration.model.ts @@ -5,6 +5,7 @@ class RegistrationSchema { email: string; firstName: string; lastName: string; + phoneNumber: string; } export class Registration extends RegistrationSchema { @@ -27,6 +28,7 @@ export class RegistrationAdapter { email: obj.email, first_name: obj.firstName, last_name: obj.lastName, + phone_number: obj.phoneNumber, } } } diff --git a/src/app/signup/student-signup/student-signup.component.html b/src/app/signup/student-signup/student-signup.component.html index e4b8336..a62a8c6 100644 --- a/src/app/signup/student-signup/student-signup.component.html +++ b/src/app/signup/student-signup/student-signup.component.html @@ -16,7 +16,16 @@ <!-- Email --> <mat-form-field class="full-width"> <input matInput type="email" formControlName="email" placeholder="Adresse email" required> - <mat-hint>Elle te servira d'identifiant de connexion.</mat-hint> + <mat-hint> + Elle te servira d'identifiant de connexion. + </mat-hint> + </mat-form-field> + + <mat-form-field class="full-width"> + <input matInput type="tel" formControlName="phoneNumber" placeholder="Numéro de téléphone" required> + <mat-hint> + Il nous permettra de te contacter en cas de nécessité. + </mat-hint> </mat-form-field> <!-- Password --> diff --git a/src/app/signup/student-signup/student-signup.component.ts b/src/app/signup/student-signup/student-signup.component.ts index bd65230..a1e0cd0 100644 --- a/src/app/signup/student-signup/student-signup.component.ts +++ b/src/app/signup/student-signup/student-signup.component.ts @@ -37,6 +37,7 @@ export class StudentSignupComponent implements OnInit { firstName: '', lastName: '', email: ['', Validators.email], + phoneNumber: '', password: '', passwordConfirm: '', }, { validator: (group) => this.checkPasswords(group)}) -- GitLab