mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Change /bookmarks URL back to topic list and add bookmark poster avatars (#9759)
* Changes the /bookmarks URL to show the original "topics filtered by bookmark" list instead of redirecting to user activity bookmarks (see https://meta.discourse.org/t/domain-com-bookmarks-is-showing-domain-com-u-user-activity-bookmarks-with-reminders/149252/12) * Add the user avatar for the user who made the post that is bookmarked
This commit is contained in:
@@ -24,7 +24,9 @@ class UserBookmarkSerializer < ApplicationSerializer
|
||||
:highest_post_number,
|
||||
:bumped_at,
|
||||
:slug,
|
||||
:username
|
||||
:post_user_username,
|
||||
:post_user_avatar_template,
|
||||
:post_user_name
|
||||
|
||||
def topic
|
||||
@topic ||= object.topic || Topic.unscoped.find(object.topic_id)
|
||||
@@ -94,7 +96,19 @@ class UserBookmarkSerializer < ApplicationSerializer
|
||||
topic.slug
|
||||
end
|
||||
|
||||
def username
|
||||
post.user.username
|
||||
def post_user
|
||||
@post_user ||= post.user
|
||||
end
|
||||
|
||||
def post_user_username
|
||||
post_user.username
|
||||
end
|
||||
|
||||
def post_user_avatar_template
|
||||
post_user.avatar_template
|
||||
end
|
||||
|
||||
def post_user_name
|
||||
post_user.name
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user