mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 19:34:09 +08:00
c07dd0d22a
This is so users with huge amount of bookmarks do not have to wait a long time to see results. * Add a bookmark list and list serializer to server-side to be able to handle paging and load more URL * Use load-more component to load more bookmark items, 20 at a time in user activity * Change the way current user is loaded for bookmark ember models because it was breaking/losing resolvedTimezone when loading more items
12 lines
287 B
Ruby
12 lines
287 B
Ruby
# frozen_string_literal: true
|
|
|
|
class UserBookmarkListSerializer < ApplicationSerializer
|
|
attributes :more_bookmarks_url
|
|
|
|
has_many :bookmarks, serializer: UserBookmarkSerializer, embed: :objects
|
|
|
|
def include_more_bookmarks_url?
|
|
object.bookmarks.size == object.per_page
|
|
end
|
|
end
|