'API return to my angular app 2 employee identic
My API returns this JSON, it's the same employee which is present 2 times in my database. I can't delete it in my database, also how can I print only 1 of them when I make my get in angular? Or when I make my *ngfor:"let e of employee", how can I print only the first result?
getEmployee(id: string){
return this.http.get<any>(this.localUrlAPI+"/employee/getEmployee/"+id)
.pipe(map((res:any)=>{
return res.Data;
}))
}
{
"Data":[
{
"IdEmployee": "1",
"Name": "Jacob"
}
{
"IdEmployee": "1",
"Name" ; "Jacob"
}
]
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
