diff options
author | Tucker Evans <tuckerevans24@gmail.com> | 2019-12-02 20:10:03 -0500 |
---|---|---|
committer | Tucker Evans <tuckerevans24@gmail.com> | 2019-12-02 20:10:03 -0500 |
commit | 4612a506a8ccb7859e08ff75f9aef5f9de2b1aba (patch) | |
tree | 758e9eb41348595ccc4b64c7290b9e41ee9b7be7 /recipeBuddy/src/app/REST_service | |
parent | 05da6e948976810317049e981fc0d0535669b482 (diff) |
Add getRecipe to backend service
Diffstat (limited to 'recipeBuddy/src/app/REST_service')
-rw-r--r-- | recipeBuddy/src/app/REST_service/backend.service.ts | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/recipeBuddy/src/app/REST_service/backend.service.ts b/recipeBuddy/src/app/REST_service/backend.service.ts index cc08bc6..9903ad0 100644 --- a/recipeBuddy/src/app/REST_service/backend.service.ts +++ b/recipeBuddy/src/app/REST_service/backend.service.ts @@ -47,6 +47,17 @@ export class BackendService { ) } + getRecipe(id): Observable<Recipe> + { + console.log(this.apiURL + '/recipes' + id) + return this.http.get<Msg>(this.apiURL + '/recipes/' + id) + .pipe ( + retry(1), + map(msg => msg.Data), + catchError(this.handleError) + ) + } + handleError(error) { let errMsg = ''; if (error.error instanceof ErrorEvent) { |