diff --git a/src/app/form/form.component.ts b/src/app/form/form.component.ts index 3e931bedada2803a234a7ab0b89ca453f05fdc6f..93ab67f337a7341b780192c3fc491270853aeb2e 100644 --- a/src/app/form/form.component.ts +++ b/src/app/form/form.component.ts @@ -253,13 +253,11 @@ export class FormComponent implements OnInit { } public onSubmitClaimWithAccount(): void { - this.structureService - .claimStructureWithAccount(this.structureId, this.profile.email) - .subscribe((structuresLinked) => { - this.profile.pendingStructuresLink = structuresLinked; - this.profileService.setProfile(this.profile); - this.closeEvent.emit(this.structureForm.value); - }); + this.structureService.claimStructureWithAccount(this.structureId, this.profile).subscribe((structuresLinked) => { + this.profile.pendingStructuresLink = structuresLinked; + this.profileService.setProfile(this.profile); + this.closeEvent.emit(this.structureForm.value); + }); } public onSubmit(structureForm: FormGroup): void { if (structureForm.valid) { diff --git a/src/app/services/structure.service.ts b/src/app/services/structure.service.ts index e28d78f8f4bacf463e01f4bfdd1ee32a232110fe..5b928a6a5bf877e042e7c336774891d5c0416ce7 100644 --- a/src/app/services/structure.service.ts +++ b/src/app/services/structure.service.ts @@ -35,8 +35,8 @@ export class StructureService { return this.http.get(`${this.baseUrl}/${id}/isClaimed`); } - public claimStructureWithAccount(id: string, email: string): Observable<string[]> { - return this.http.post<any>(`${this.baseUrl}/${id}/claim`, { email }); + public claimStructureWithAccount(id: string, user: User): Observable<string[]> { + return this.http.post<any>(`${this.baseUrl}/${id}/claim`, user); } public getStructure(id: string): Observable<Structure> {