Skip to content
Snippets Groups Projects
Commit 0f9e822e authored by Jérémie BRISON's avatar Jérémie BRISON Committed by Hugo SUBTIL
Browse files

feat(admin) : fix model

parent 16e621cd
No related branches found
No related tags found
3 merge requests!68Recette,!67Dev,!51Feat/admin panel attachment
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
</thead> </thead>
<tbody> <tbody>
<tr *ngFor="let demand of demandsAttachment"> <tr *ngFor="let demand of demandsAttachment">
<td>{{ demand.user.email }}</td> <td>{{ demand.userEmail }}</td>
<td>{{ demande.structure.structureName }}</td> <td>{{ demand.structureId }}</td>
<td> <td>
<button (click)="acceptDemand(demand)">Valider</button><button (click)="refuseDemand(demand)">Refuser</button> <button (click)="acceptDemand(demand)">Valider</button><button (click)="refuseDemand(demand)">Refuser</button>
</td> </td>
......
...@@ -21,13 +21,12 @@ export class ValidationAttachmentComponent implements OnInit { ...@@ -21,13 +21,12 @@ export class ValidationAttachmentComponent implements OnInit {
public acceptDemand(demand: demandAttachment): void { public acceptDemand(demand: demandAttachment): void {
console.log('accept'); console.log('accept');
this.removeDemand(demand); this.removeDemand(demand);
this.adminService.acceptAttachmentStructure(demand.userEmail, demand.structureId);
this.adminService.acceptAttachmentStructure(demand.user.email, demand.structure.id);
} }
public refuseDemand(demand: demandAttachment): void { public refuseDemand(demand: demandAttachment): void {
console.log('refuse'); console.log('refuse');
this.adminService.refuseAttachmentStructure(demand.user.email, demand.structure.id); this.adminService.refuseAttachmentStructure(demand.userEmail, demand.structureId);
this.removeDemand(demand); this.removeDemand(demand);
} }
......
...@@ -2,6 +2,6 @@ import { Structure } from '../../models/structure.model'; ...@@ -2,6 +2,6 @@ import { Structure } from '../../models/structure.model';
import { User } from '../../models/user.model'; import { User } from '../../models/user.model';
export class demandAttachment { export class demandAttachment {
user: User; userEmail: string;
structure: Structure; structureId: number;
} }
...@@ -9,9 +9,12 @@ export class AdminService { ...@@ -9,9 +9,12 @@ export class AdminService {
// Return pendingAttachments of all profiles. // Return pendingAttachments of all profiles.
public getPendingAttachmentsStructure(): demandAttachment[] { public getPendingAttachmentsStructure(): demandAttachment[] {
return [new demandAttachment()]; return [{ userEmail: 'jb@test.fr', structureId: 53 }];
} }
// Post
public acceptAttachmentStructure(mailUser, idStructure): void {} public acceptAttachmentStructure(mailUser, idStructure): void {}
// Post
public refuseAttachmentStructure(mailUser, idStructure): void {} public refuseAttachmentStructure(mailUser, idStructure): void {}
} }
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