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, 10 insertions, 1 deletions
diff --git a/recipeBuddy/src/app/REST_service/backend.service.ts b/recipeBuddy/src/app/REST_service/backend.service.ts
index 8ae05ca..1a2d933 100644
--- a/recipeBuddy/src/app/REST_service/backend.service.ts
+++ b/recipeBuddy/src/app/REST_service/backend.service.ts
@@ -47,9 +47,9 @@ 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),
@@ -70,6 +70,15 @@ export class BackendService {
JSON.stringify(data), this.httpOptions)
}
+ deleteRecipe(id): Observable<Msg>
+ {
+ return this.http.delete<Msg>(this.apiURL + '/recipes/' + id)
+ .pipe (
+ retry(1),
+ catchError(this.handleError)
+ )
+ }
+
handleError(error) {
let errMsg = '';
if (error.error instanceof ErrorEvent) {