Implement function mergePeopleWithAnimals
, which should fetch list of people and list of animals, and merge them by animalId. Result should be:
[
{
name: "John",
id: 1,
animal: {
name: "Piggy",
id: 3,
sound: "qui",
},
},
...
]
https://private-anon-d1351ae69b-giboork.apiary-mock.com/people
[
{
"name": "John",
"id": 1,
"animalId": 3
},
{
"name": "Albert",
"id": 2,
"animalId": 9
},
{
"name": "john",
"id": 3,
"animalId": 6
}
]
https://private-anon-d1351ae69b-giboork.apiary-mock.com/animals
[
{
"name": "Piggy",
"id": 3,
"sound": "qui"
},
{
"name": "Tiggy",
"id": 6,
"sound": "rawr"
},
{
"name": "Froggy",
"id": 9,
"sound": "quack"
}
]