Skip to content

Commit

Permalink
fix: user full name on recipe comments
Browse files Browse the repository at this point in the history
fix: user full name on recipe comments

add tests
  • Loading branch information
krit.k authored and OozyGrub committed Oct 1, 2024
1 parent 1bd3d38 commit 0b0c367
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<UserAvatar size="40" :user-id="comment.userId" />
<v-card outlined class="flex-grow-1">
<v-card-text class="pa-3 pb-0">
<p class="">{{ comment.user.username }} • {{ $d(Date.parse(comment.createdAt), "medium") }}</p>
<p class="">{{ comment.user.fullName }} • {{ $d(Date.parse(comment.createdAt), "medium") }}</p>
<SafeMarkdown :source="comment.text" />
</v-card-text>
<v-card-actions class="justify-end mt-0 pt-0">
Expand Down
1 change: 1 addition & 0 deletions mealie/schema/recipe/recipe_comments.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
class UserBase(MealieModel):
id: UUID4
username: str | None = None
full_name: str | None = None
admin: bool
model_config = ConfigDict(from_attributes=True)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def test_create_comment(api_client: TestClient, unique_recipe: Recipe, unique_us
assert response_data[0]["recipeId"] == str(unique_recipe.id)
assert response_data[0]["text"] == create_data["text"]
assert response_data[0]["userId"] == str(unique_user.user_id)
assert len(response_data[0]["user"]["fullName"]) > 0


def test_update_comment(api_client: TestClient, unique_recipe: Recipe, unique_user: TestUser):
Expand Down

0 comments on commit 0b0c367

Please sign in to comment.