last changes
This commit is contained in:
@ -5,6 +5,7 @@
|
||||
"ng": "ng",
|
||||
"start": "ng serve",
|
||||
"build": "ng build",
|
||||
"build-prod": "ng build --prod",
|
||||
"test": "ng test",
|
||||
"lint": "ng lint",
|
||||
"e2e": "ng e2e"
|
||||
|
@ -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