Matt Raible 7 years ago
parent
commit
5c402a2369
1 changed files with 1 additions and 3 deletions
  1. 1
    3
      client/src/providers/beer-service.ts

+ 1
- 3
client/src/providers/beer-service.ts View File

32
   save(beer: any): Observable<any> {
32
   save(beer: any): Observable<any> {
33
     let result: Observable<Response>;
33
     let result: Observable<Response>;
34
     if (beer['href']) {
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
     } else {
36
     } else {
39
       result = this.http.post(this.BEER_API, beer)
37
       result = this.http.post(this.BEER_API, beer)
40
     }
38
     }