Fix code style issues
This commit is contained in:
parent
290c6b0f2e
commit
f39bba9a90
|
@ -15,7 +15,7 @@ class Api::V1::MutesController < Api::BaseController
|
|||
def details
|
||||
@data = @mutes = load_mutes
|
||||
render json: @mutes, each_serializer: REST::MuteSerializer
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
|
@ -44,19 +44,15 @@ class Api::V1::MutesController < Api::BaseController
|
|||
end
|
||||
|
||||
def next_path
|
||||
if records_continue?
|
||||
url_for pagination_params(max_id: pagination_max_id)
|
||||
end
|
||||
url_for pagination_params(max_id: pagination_max_id) if records_continue?
|
||||
end
|
||||
|
||||
def prev_path
|
||||
unless@data.empty?
|
||||
url_for pagination_params(since_id: pagination_since_id)
|
||||
end
|
||||
url_for pagination_params(since_id: pagination_since_id) unless @data.empty?
|
||||
end
|
||||
|
||||
def pagination_max_id
|
||||
if params[:action] == "details"
|
||||
if params[:action] == 'details'
|
||||
@mutes.last.id
|
||||
else
|
||||
@accounts.last.muted_by_ids.last
|
||||
|
@ -64,7 +60,7 @@ class Api::V1::MutesController < Api::BaseController
|
|||
end
|
||||
|
||||
def pagination_since_id
|
||||
if params[:action] == "details"
|
||||
if params[:action] == 'details'
|
||||
@mutes.first.id
|
||||
else
|
||||
@accounts.first.muted_by_ids.first
|
||||
|
|
|
@ -19,7 +19,7 @@ module AccountInteractions
|
|||
def muting_map(target_account_ids, account_id)
|
||||
Mute.where(target_account_id: target_account_ids, account_id: account_id).each_with_object({}) do |mute, mapping|
|
||||
mapping[mute.target_account_id] = {
|
||||
notifications: mute.hide_notifications?
|
||||
notifications: mute.hide_notifications?,
|
||||
}
|
||||
end
|
||||
end
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
class REST::MuteSerializer < ActiveModel::Serializer
|
||||
include RoutingHelper
|
||||
|
||||
|
||||
attributes :id, :account, :target_account, :created_at, :hide_notifications
|
||||
|
||||
def account
|
||||
|
@ -12,4 +12,5 @@ class REST::MuteSerializer < ActiveModel::Serializer
|
|||
def target_account
|
||||
REST::AccountSerializer.new(object.target_account)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Reference in New Issue