I'm trying to post a request for authorizing a user. After logging in I want to send another http.post to set some information about that user. So far my login call works : (Angular) auth_service.ts :
Login() {
let promiseResult : any;
this.http.post<any>('/auth/Login', this.auth_payload).toPromise().then(data => {
promiseResult = data;
console.log("Login call" ,promiseResult)
return promiseResult
});
auth_component.ts :
onSubmit(form : NgForm){
this.authService.Login()
}
I'm having trouble understanding how to make the second post request work. I want to press a button on the HTML upon which the response from the second call will be retrieved. How should I make a "connection" between these two requests?
I've read about Promises and Observables but I don't get how do I use them in this case.