Commit e7280e68 authored by Sofia Aicha Delijaj's avatar Sofia Aicha Delijaj
Browse files

now you can delete a friend, sad times

parent c6778c37
......@@ -18,7 +18,7 @@ Partie.create = (uid, pseudo, result) => {
}
console.log("created request: " + pseudo + " " + uid);
result(null, {id: res.insertId});
result(null, { id: res.insertId });
});
};
......
......@@ -22,6 +22,12 @@
<div class="container py-3" *ngIf="amis!=null">
<div *ngFor="let ami of amis; let i=index">
<h4>{{ami.pseudo}}</h4>
<div class="btn btn-primary" id="ami" (click)="refuser(ami)">
<h6>Effacer</h6>
</div>
<!-- <div class="btn btn-primary" (click)="">
<h6>Défier</h6>
</div> -->
</div>
</div>
</div>
......
......@@ -54,13 +54,15 @@ export class FriendsMenuComponent implements OnInit {
}
isFriend(){
if(this.resultat.res.length > 0){
for(let i = 0; i < this.resultat.res.length; i++){
if(this.resultat.res[i].accept === 1){
this.amis.push(this.resultat.res[i])
} else {
this.requests.push(this.resultat.res[i])
}
}
}
}
}
accepter(idAmi){
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment