Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: user full name on recipe comments #4295

Closed
wants to merge 3 commits into from
Closed
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
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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would make sense to add fullName to our TestUser so we can compare the result directly. Is that something you could do?



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