Skip to content
This repository has been archived by the owner on Sep 29, 2024. It is now read-only.

display metadata for mobile view #358

Merged
merged 2 commits into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Backend/API/Controllers/UserController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public IActionResult GetLikedRecipes(int userId)
return NotFound("User not found.");
}

var likedRecipes = _userService.GetLikedRecipesByUserId(userId);
var likedRecipes = _userService.GetLikedRecipesByUserId(userId)?.Select(recipe => recipe.ToModel());
return Ok(likedRecipes);
}

Expand Down
4 changes: 2 additions & 2 deletions Backend/Tests/ApiTests/UserControllerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ public void GetLikedRecipes_Success()

// ASSERT
Assert.IsType<OkObjectResult>(result);
var likedRecipes = ResponseMessageOf(result) as IEnumerable<Recipe>;
var likedRecipes = ResponseMessageOf(result) as IEnumerable<RecipeModel>;
Assert.NotNull(likedRecipes);
Assert.Contains(likedRecipes, r => r.Id == recipeId1);
Assert.Contains(likedRecipes, r => r.Id == recipeId2);
Expand Down Expand Up @@ -428,7 +428,7 @@ public void GetLikedRecipes_NoLikedRecipes()

// ASSERT
Assert.IsType<OkObjectResult>(result);
var likedRecipes = ResponseMessageOf(result) as IEnumerable<Recipe>;
var likedRecipes = ResponseMessageOf(result) as IEnumerable<RecipeModel>;
Assert.NotNull(likedRecipes);
Assert.Empty(likedRecipes);
}
Expand Down
3 changes: 2 additions & 1 deletion Frontend/src/pages/MyRecipeLoggedIn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ export default function MyRecipeLoggedIn(userData: UserDataParams) {
<div className="back-content" style={{backgroundImage: imageUrl, backgroundSize: "cover", backgroundRepeat: "no-repeat"}}>
<div className="recipe-card-overlay">
<strong>{recipe.name}</strong>
<p> {recipe.prepTime} min prep | {recipe.cookingTime} min cooking</p>
<p> {recipe.prepTime} min preparation | {recipe.cookingTime} min cooking</p>
<p>{recipe.categories.join(" | ")} </p>
</div>
</div>
</div>
Expand Down
6 changes: 6 additions & 0 deletions Frontend/src/style/MyRecipeLoggedIn.css
Original file line number Diff line number Diff line change
Expand Up @@ -307,5 +307,11 @@
.header-container{
margin: 3vh 10vh;
}
.back, .front {

backface-visibility: visible;
transform: scale(1);

}
}

Loading