title: Call an api within .subcribe next in Angular
body: <p>Essentially I am trying to edit a user, and calling the editUser method in my authService. Edit user in the auth service is just a HTTP post request.</p>
  <pre><code>this._authService.editUser(this.edit).subscribe(res=&gt;{this.getUsers(this.params)}, (err)=&gt;{alert(err)})
  </code></pre>
  <p>Now after editing the user, I wanna refresh the entire User list again. therefore I am calling the getUser method inside the .subscribe next field. The getUser method in the authservice is also a HTTP POST request.</p>
  <pre><code>getUsers(search){
      this._authService.getUser(search).subscribe(
        res =&gt; {
         
          this.persons = res
          
        },
        error =&gt; {
          if(error.status == 0) {
            alert(&quot;The servers are down right now, try again later&quot;)
          }
          else{
            alert(error.error.msg)
          }
  
        }
      );
    }
  </code></pre>
  <p>The problem with this is that it doesnt always refresh the persons list. Sometimes it does and sometimes it doesnt</p>