Matt Raible 7 anni fa
parent
commit
5c402a2369
1 ha cambiato i file con 1 aggiunte e 3 eliminazioni
  1. 1
    3
      client/src/providers/beer-service.ts

+ 1
- 3
client/src/providers/beer-service.ts Vedi 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
     }