I'm in the process of learning rxjs and currently facing something I'm not quite sure how to tackle. I need to call multiple API requests, but the issue is that first I need to get a list of names, and then, for each name get the rest of the data. So far I've come up with two map functions, the first call will get list of names, and the second map will iterate over the list and call another request to get the rest of the data. I assume this is bad practice but I cannot understand how to use mergeMap or forkjoin to achieve a better functioning code.
  public getNames(): Observable<any> {
    return this.httpClient.get<response>(someUrl)
                          .pipe(map(res => res.results), map((data)=>{
                              data.forEach(dat => {
                               this.getDataByName(dat.name).subscribe(res => {
                                  dat.image = res.image;
                               });
                              });
                              return data;
                            }));
  }
  
  public getDataByName(name): Observable<any> {
    return this.httpClient.get<any>(urlToGetMoreDataByName)
                          .pipe(map(res => res.results));
  }