summaryrefslogtreecommitdiff
path: root/recipeBuddy/src/app/REST_service/backend.service.ts
diff options
context:
space:
mode:
authorTucker Evans <tuckerevans24@gmail.com>2019-11-27 22:41:40 -0500
committerTucker Evans <tuckerevans24@gmail.com>2019-12-02 19:24:21 -0500
commitb58be7e07676839d196eb3090b651448b1380249 (patch)
tree1bdf3e3b5523af15a88e0a4b08ef009fcce5013c /recipeBuddy/src/app/REST_service/backend.service.ts
parent3970d90fc06a0cc55c260a1155202eaba18e373b (diff)
Add getRecipes to BackendService
Diffstat (limited to 'recipeBuddy/src/app/REST_service/backend.service.ts')
-rw-r--r--recipeBuddy/src/app/REST_service/backend.service.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/recipeBuddy/src/app/REST_service/backend.service.ts b/recipeBuddy/src/app/REST_service/backend.service.ts
index 7834cb5..cc08bc6 100644
--- a/recipeBuddy/src/app/REST_service/backend.service.ts
+++ b/recipeBuddy/src/app/REST_service/backend.service.ts
@@ -37,6 +37,16 @@ export class BackendService {
)}
+ getRecipes(): Observable<number[]>
+ {
+ return this.http.get<MsgList>(this.apiURL + '/recipes')
+ .pipe (
+ retry(1),
+ map(msg => msg.Data),
+ catchError(this.handleError)
+ )
+ }
+
handleError(error) {
let errMsg = '';
if (error.error instanceof ErrorEvent) {