Matt Raible 7 年之前
父節點
當前提交
5c402a2369
共有 1 個文件被更改,包括 1 次插入3 次删除
  1. 1
    3
      client/src/providers/beer-service.ts

+ 1
- 3
client/src/providers/beer-service.ts 查看文件

@@ -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
     }