Skip to content
Snippets Groups Projects
Commit 7635a489 authored by Jérémie BRISON's avatar Jérémie BRISON
Browse files

fix(form) : fix user verification without new structure

parent c9f791e0
No related branches found
No related tags found
3 merge requests!68Recette,!67Dev,!66Fix/form design create structure
......@@ -2,13 +2,17 @@
<p *ngIf="!verificationSuccess && !verificationIssue">Votre email est en cours de vérification ...</p>
<div *ngIf="verificationSuccess">
<div class="title">
<h3>
<h3 *ngIf="structure">
Bravo !<br />
Votre compte et votre structure ont bien été référencés.
</h3>
<h3 *ngIf="!structure">
Bravo !<br />
Votre compte a bien été créé.
</h3>
</div>
<div class="structureInfoBlock" fxLayout="row" fxLayoutAlign=" center">
<div *ngIf="structure" class="structureInfoBlock" fxLayout="row" fxLayoutAlign=" center">
<div class="structureInfoContent" fxLayout="column">
{{ structure.structureName }}
<span>{{ structure.structureType }}</span>
......@@ -20,7 +24,7 @@
</div>
</div>
<div class="btnSection">
<button class="btn" routerLink="/home" [state]="{ data: structure }">Voir ma structure</button>
<button *ngIf="structure" class="btn" routerLink="/home" [state]="{ data: structure }">Voir ma structure</button>
</div>
</div>
<p *ngIf="verificationIssue">
......
......@@ -35,23 +35,27 @@ export class UserVerificationComponent implements OnInit {
private sendVerification(): void {
this.authService.verifyUser(this.userId, this.token).subscribe(
(user: User) => {
this.structureService.getStructure(user.structuresLink[0]).subscribe(
(structure) => {
structure.accountVerified = true;
this.structure = structure;
this.structureService.updateStructureAfterOwnerVerify(structure._id, user).subscribe(
() => {
this.verificationSuccess = true;
},
() => {
this.verificationIssue = true;
}
);
},
() => {
this.verificationIssue = true;
}
);
if (user.structuresLink[0]) {
this.structureService.getStructure(user.structuresLink[0]).subscribe(
(structure) => {
structure.accountVerified = true;
this.structure = structure;
this.structureService.updateStructureAfterOwnerVerify(structure._id, user).subscribe(
() => {
this.verificationSuccess = true;
},
() => {
this.verificationIssue = true;
}
);
},
() => {
this.verificationIssue = true;
}
);
} else {
this.verificationSuccess = true;
}
},
() => {
this.verificationIssue = true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment