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

fix(form) : fix update properties structure

parent 65516ab1
Branches
Tags
3 merge requests!68Recette,!67Dev,!66Fix/form design create structure
...@@ -20,10 +20,10 @@ export class StructureService { ...@@ -20,10 +20,10 @@ export class StructureService {
private readonly baseUrl = 'api/structures'; private readonly baseUrl = 'api/structures';
constructor(private http: HttpClient) {} constructor(private http: HttpClient) {}
public updateStructureAfterOwnerVerify(id: string, structure: Structure): Observable<Structure> { public updateStructureAfterOwnerVerify(idStructure: string, user: User): Observable<any> {
delete structure._id; // id should not be provided for update const emailUser = user.email;
return this.http return this.http
.put(`${this.baseUrl}/updateAfterOwnerVerify/${id}`, structure) .put(`${this.baseUrl}/updateAfterOwnerVerify/${idStructure}`, { emailUser })
.pipe(map((item: Structure) => new Structure(item))); .pipe(map((item: Structure) => new Structure(item)));
} }
public createStructure(structure: Structure, profile: User): Observable<Structure> { public createStructure(structure: Structure, profile: User): Observable<Structure> {
......
...@@ -39,7 +39,7 @@ export class UserVerificationComponent implements OnInit { ...@@ -39,7 +39,7 @@ export class UserVerificationComponent implements OnInit {
(structure) => { (structure) => {
structure.accountVerified = true; structure.accountVerified = true;
this.structure = structure; this.structure = structure;
this.structureService.updateStructureAfterOwnerVerify(structure._id, structure).subscribe( this.structureService.updateStructureAfterOwnerVerify(structure._id, user).subscribe(
() => { () => {
this.verificationSuccess = true; this.verificationSuccess = true;
}, },
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment