discourse/plugins/chat/app/controllers/api/chat_channel_memberships_co...

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 lines
519 B
Ruby
Raw Normal View History

# frozen_string_literal: true
class Chat::Api::ChatChannelMembershipsController < Chat::Api::ChatChannelsController
def index
channel = find_chat_channel
offset = (params[:offset] || 0).to_i
limit = (params[:limit] || 50).to_i.clamp(1, 50)
memberships =
ChatChannelMembershipsQuery.call(
channel,
offset: offset,
limit: limit,
username: params[:username],
)
render_serialized(memberships, UserChatChannelMembershipSerializer, root: false)
end
end