gitlab-org--gitlab-foss/app/services/chat_names/request_service.rb

33 lines
635 B
Ruby
Raw Normal View History

module ChatNames
class RequestService
include Gitlab::Routing.url_helpers
def initialize(service, params)
@service = service
@params = params
end
def execute
token = chat_name_token.store!(chat_name_params)
new_profile_chat_name_url(token: token) if token
end
private
def chat_name_token
Gitlab::ChatNameToken.new
end
def chat_name_params
{
service_id: @service.id,
team_id: @params[:team_id],
team_domain: @params[:team_domain],
chat_id: @params[:user_id],
chat_name: @params[:user_name]
}
end
end
end