summaryrefslogtreecommitdiff
path: root/recipeBuddy/src/app
diff options
context:
space:
mode:
Diffstat (limited to 'recipeBuddy/src/app')
-rw-r--r--recipeBuddy/src/app/REST_service/backend.service.ts11
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) {