This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/plugins/chat/app/controllers/api/chat_channel_memberships_controller.rb
Roman Rizzi 0a5f548635
DEV: Move discourse-chat to the core repo. (#18776)
As part of this move, we are also renaming `discourse-chat` to `chat`.
2022-11-02 10:41:30 -03:00

21 lines
519 B
Ruby

# 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