avancées signup
This commit is contained in:
parent
58abccca86
commit
c07b32cad1
@ -8,4 +8,5 @@ export interface Membre {
|
|||||||
couleur: string;
|
couleur: string;
|
||||||
passwordConfirm: string;
|
passwordConfirm: string;
|
||||||
roleList: string[];
|
roleList: string[];
|
||||||
|
teamId?: string;
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@ import {
|
|||||||
FormGroup,
|
FormGroup,
|
||||||
Validators,
|
Validators,
|
||||||
} from '@angular/forms';
|
} from '@angular/forms';
|
||||||
import { Router, RouterLink } from '@angular/router';
|
import { Router} from '@angular/router';
|
||||||
import { Team } from 'src/app/models/team';
|
import { Team } from 'src/app/models/team';
|
||||||
import { TeamService } from 'src/app/services/team.service';
|
import { TeamService } from 'src/app/services/team.service';
|
||||||
import { Membre } from '../../models/membre';
|
import { Membre } from '../../models/membre';
|
||||||
@ -59,7 +59,7 @@ export class PageSignupComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public onSubmit(): void {
|
public onSubmit(): void {
|
||||||
const teamIdValue = this.signupForm.value[''];
|
let teamIdValue = '';
|
||||||
const teamNameValue = this.signupForm.value['teamNameFc'];
|
const teamNameValue = this.signupForm.value['teamNameFc'];
|
||||||
const idValue = this.signupForm.value[''];
|
const idValue = this.signupForm.value[''];
|
||||||
const prenomValue = this.signupForm.value['firstNameFc'];
|
const prenomValue = this.signupForm.value['firstNameFc'];
|
||||||
@ -85,16 +85,20 @@ export class PageSignupComponent implements OnInit {
|
|||||||
couleur: couleurValue,
|
couleur: couleurValue,
|
||||||
dateNaissance: dateNaissanceValue,
|
dateNaissance: dateNaissanceValue,
|
||||||
passwordConfirm: passwordConfirmValue,
|
passwordConfirm: passwordConfirmValue,
|
||||||
//team: teamIdValue,
|
teamId: teamIdValue,
|
||||||
roleList: roleValue,
|
roleList: roleValue,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (membre.email !== '' && membre.password !== '' && team.nom!== '') {
|
if (membre.email !== '' && membre.password !== '' && team.nom!== '') {
|
||||||
this.teamService.addTeam(team).subscribe((resp) => {
|
this.teamService.addTeam(team).subscribe((respTeam) => {
|
||||||
return resp
|
teamIdValue = respTeam.id;
|
||||||
});
|
console.log(teamIdValue);
|
||||||
this.authService.signup(membre).subscribe((resp) => {
|
this.authService.signup(membre).subscribe((respMembre) => {
|
||||||
this.router.navigate(['accueil']);
|
this.router.navigate(['accueil']);
|
||||||
|
console.log(teamIdValue);
|
||||||
|
return respMembre
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// affichage erreur
|
// affichage erreur
|
||||||
|
Loading…
Reference in New Issue
Block a user