|
@@ -32,9 +32,7 @@ export class BeerService {
|
32
|
32
|
save(beer: any): Observable<any> {
|
33
|
33
|
let result: Observable<Response>;
|
34
|
34
|
if (beer['href']) {
|
35
|
|
- // get id from href
|
36
|
|
- let id = beer.href.substring(beer.href.lastIndexOf('/'));
|
37
|
|
- result = this.http.put(this.BEER_API + id, beer);
|
|
35
|
+ result = this.http.put(beer.href, beer);
|
38
|
36
|
} else {
|
39
|
37
|
result = this.http.post(this.BEER_API, beer)
|
40
|
38
|
}
|