diff --git a/src/app/admin/components/claim-structure/claim-structure.component.ts b/src/app/admin/components/claim-structure/claim-structure.component.ts index e6e8f1338949af736a38bdc97e159870bd54c018..28e1701d0d63a3ecc84731ba756d734d90d6732c 100644 --- a/src/app/admin/components/claim-structure/claim-structure.component.ts +++ b/src/app/admin/components/claim-structure/claim-structure.component.ts @@ -17,14 +17,18 @@ export class ClaimStructureComponent implements OnInit { } public acceptDemand(demand: DemandAttachment): void { - this.adminService.acceptStructureClaim(demand.userEmail, demand.structureId).subscribe((data) => { - this.demandsAttachment = data; - }); + this.adminService + .acceptStructureClaim(demand.userEmail, demand.structureId, demand.structureName) + .subscribe((data) => { + this.demandsAttachment = data; + }); } public refuseDemand(demand: DemandAttachment): void { - this.adminService.refuseStructureClaim(demand.userEmail, demand.structureId).subscribe((data) => { - this.demandsAttachment = data; - }); + this.adminService + .refuseStructureClaim(demand.userEmail, demand.structureId, demand.structureName) + .subscribe((data) => { + this.demandsAttachment = data; + }); } } diff --git a/src/app/admin/services/admin.service.ts b/src/app/admin/services/admin.service.ts index 0167109c5db0f424f33bfff31dcae7ae38086541..cdea9a41bafe956e74a11c854f61b50bf173bec9 100644 --- a/src/app/admin/services/admin.service.ts +++ b/src/app/admin/services/admin.service.ts @@ -15,11 +15,27 @@ export class AdminService { return this.http.get<DemandAttachment[]>(`${this.baseUrl}/pendingStructures`); } - public acceptStructureClaim(userEmail: string, structureId: number): Observable<DemandAttachment[]> { - return this.http.post<DemandAttachment[]>(`${this.baseUrl}/validatePendingStructure`, { userEmail, structureId }); + public acceptStructureClaim( + userEmail: string, + structureId: number, + structureName: string + ): Observable<DemandAttachment[]> { + return this.http.post<DemandAttachment[]>(`${this.baseUrl}/validatePendingStructure`, { + userEmail, + structureId, + structureName, + }); } - public refuseStructureClaim(userEmail: string, structureId: number): Observable<DemandAttachment[]> { - return this.http.post<DemandAttachment[]>(`${this.baseUrl}/rejectPendingStructure`, { userEmail, structureId }); + public refuseStructureClaim( + userEmail: string, + structureId: number, + structureName: string + ): Observable<DemandAttachment[]> { + return this.http.post<DemandAttachment[]>(`${this.baseUrl}/rejectPendingStructure`, { + userEmail, + structureId, + structureName, + }); } }