From 7450796a6b77adbf09879aa9a33ba09c16120d1a Mon Sep 17 00:00:00 2001 From: Kenta420 Date: Thu, 5 Oct 2023 09:39:25 +0700 Subject: [PATCH] update test get recipe metadatas --- .../src/app/core/services/recipe.service.ts | 24 ++++++++- .../recipe-modal.component.html | 6 ++- .../recipe-details/recipe-modal.component.ts | 52 ++++++++++++------- server/routers/recipe.go | 50 ++++++++++++------ 4 files changed, 95 insertions(+), 37 deletions(-) diff --git a/client/src/app/core/services/recipe.service.ts b/client/src/app/core/services/recipe.service.ts index 21abd16..e6d5c53 100644 --- a/client/src/app/core/services/recipe.service.ts +++ b/client/src/app/core/services/recipe.service.ts @@ -60,8 +60,28 @@ export class RecipeService { return 'coffeethai02_580.json'; } - getRecipesById(id: string): Observable { - return this._httpClient.get(environment.api + '/recipes/' + id, { + getRecipesById(id: string): Observable<{ + recipe: Recipe01; + recipeMetaData: { + productCode: string; + name: string; + otherName: string; + description: string; + otherDescription: string; + picture: string; + }; + }> { + return this._httpClient.get<{ + recipe: Recipe01; + recipeMetaData: { + productCode: string; + name: string; + otherName: string; + description: string; + otherDescription: string; + picture: string; + }; + }>(environment.api + '/recipes/' + id, { withCredentials: true, responseType: 'json', }); diff --git a/client/src/app/shared/modal/recipe-details/recipe-modal.component.html b/client/src/app/shared/modal/recipe-details/recipe-modal.component.html index 7ef38fb..568468b 100644 --- a/client/src/app/shared/modal/recipe-details/recipe-modal.component.html +++ b/client/src/app/shared/modal/recipe-details/recipe-modal.component.html @@ -24,7 +24,11 @@