function completeRegistration(email: string, password: string, firstName: string, lastName: string, location: string): Observable<UserDetails> {
let body = JSON.stringify({ email, password, firstName, lastName,location });
let headers = new Headers({ 'Content-Type': 'application/json' });
let options = new RequestOptions({ headers: headers });
return this.http.post(this.baseUrl + "/accounts", body, options)
.map(res => true)
.catch(this.handleError);
}
While incorporating code I found online into my project, I encountered an issue. The error message displayed is:
Type 'Observable<boolean>' is not assignable to type 'Observable<UserDetails>'.
Type 'boolean' is not assignable to type 'UserDetails'.
The code also references the following interface:
export interface UserDetails {
email: string;
password: string;
firstName: string;
lastName: string;
location: string;
}