create() should return Hero model. (#3414)
This commit is contained in:
parent
a083fdbe8b
commit
d65f1943e3
@ -61,7 +61,7 @@ export class HeroService {
|
|||||||
return this.http
|
return this.http
|
||||||
.post(this.heroesUrl, JSON.stringify({name: name}), {headers: this.headers})
|
.post(this.heroesUrl, JSON.stringify({name: name}), {headers: this.headers})
|
||||||
.toPromise()
|
.toPromise()
|
||||||
.then(res => res.json().data)
|
.then(res => res.json().data as Hero)
|
||||||
.catch(this.handleError);
|
.catch(this.handleError);
|
||||||
}
|
}
|
||||||
// #enddocregion create
|
// #enddocregion create
|
||||||
|
Loading…
x
Reference in New Issue
Block a user