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