I have a problem that I don't know how to resolve. I'm going to simplify it so that I can explain it better.
I have one API endpoint that returns me a list of persons, and other API endpoint where i can ask for the pets that a person has using the person ID (something like: api/pets/:person_id/).
The api for query the persons returns me an array that looks something like this:
[
{
person_id: 123,
name: "John Abc"
},
...
]
What I need is to add the array of pets for each element/person that the api of persons returns me, so that I end with something like this:
[
{
person_id: 123,
name: "John Abc",
pets: [
{ pet_id: 5, pet_name: 'doggy' },
{ pet_id: 7, pet_name: 'foobar' },
...
]
},
...
]
I'm new to RxJs, I have read about different operators but this is something more complex that I have done previously. Any help will be appreciated.