last changes
This commit is contained in:
@ -13,16 +13,16 @@ export class HeroService {
|
||||
|
||||
getHeroes(): Promise<Hero[]> {
|
||||
this.messageService.add('HeroService: fetched heroes');
|
||||
return this.http.get<Hero[]>(`http://172.16.3.185:5000/heroes`).toPromise()
|
||||
return this.http.get<Hero[]>(`http://172.16.3.185:5000/heroes/heroes`).toPromise()
|
||||
}
|
||||
|
||||
getHero(id: number): Promise<Hero> {
|
||||
this.messageService.add(`HeroService: fetch hero id=${id}`);
|
||||
return this.http.get<Hero>(`http://172.16.3.185:5000/hero/${id}`).toPromise()
|
||||
return this.http.get<Hero>(`http://172.16.3.185:5000/heroes/hero/${id}`).toPromise()
|
||||
}
|
||||
|
||||
updateHero(hero: Hero): Promise<any> {
|
||||
this.messageService.add(`HeroService: save change: id=${hero.id}, name=${hero.name}`);
|
||||
return this.http.put<Hero>(`http://172.16.3.185:5000/hero/${hero.id}`, hero).toPromise()
|
||||
return this.http.put<Hero>(`http://172.16.3.185:5000/heroes/hero/${hero.id}`, hero).toPromise()
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user