Change source
attribute of Suggestion
entity in /api/v2/suggestions
back to a string (#29108)
This commit is contained in:
parent
1e0b0a3486
commit
7ee93b7431
6 changed files with 41 additions and 10 deletions
|
@ -31,12 +31,12 @@ class AccountSuggestions
|
|||
account_ids = account_ids_with_sources[offset, limit]
|
||||
accounts_map = Account.where(id: account_ids.map(&:first)).includes(:account_stat, :user).index_by(&:id)
|
||||
|
||||
account_ids.filter_map do |(account_id, source)|
|
||||
account_ids.filter_map do |(account_id, sources)|
|
||||
next unless accounts_map.key?(account_id)
|
||||
|
||||
AccountSuggestions::Suggestion.new(
|
||||
account: accounts_map[account_id],
|
||||
source: source
|
||||
sources: sources
|
||||
)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AccountSuggestions::Suggestion < ActiveModelSerializers::Model
|
||||
attributes :account, :source
|
||||
attributes :account, :sources
|
||||
|
||||
delegate :id, to: :account, prefix: true
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue