Commit 8ca5fef9 authored by Kamil Trzcinski's avatar Kamil Trzcinski

Use single presenter for everything

parent 37057870
...@@ -33,10 +33,10 @@ class ChatSlashCommandsService < Service ...@@ -33,10 +33,10 @@ class ChatSlashCommandsService < Service
user = find_chat_user(params) user = find_chat_user(params)
unless user unless user
url = authorize_chat_name_url(params) url = authorize_chat_name_url(params)
return presenter.authorize_chat_name(url) return Gitlab::ChatCommands::Presenter.authorize_chat_name(url)
end end
Gitlab::ChatCommands::Command.new(presenter, project, user, params).execute Gitlab::ChatCommands::Command.new(project, user, params).execute
end end
private private
...@@ -48,8 +48,4 @@ class ChatSlashCommandsService < Service ...@@ -48,8 +48,4 @@ class ChatSlashCommandsService < Service
def authorize_chat_name_url(params) def authorize_chat_name_url(params)
ChatNames::AuthorizeUserService.new(self, params).execute ChatNames::AuthorizeUserService.new(self, params).execute
end end
def presenter
throw NotImplementedError
end
end end
...@@ -18,8 +18,4 @@ class MattermostSlashCommandsService < ChatService ...@@ -18,8 +18,4 @@ class MattermostSlashCommandsService < ChatService
def to_param def to_param
'mattermost_slash_commands' 'mattermost_slash_commands'
end end
def presenter
Gitlab::ChatCommands::Presenters::Mattermost.new
end
end end
...@@ -12,8 +12,4 @@ class SlackSlashCommandsService < ChatSlashCommandsService ...@@ -12,8 +12,4 @@ class SlackSlashCommandsService < ChatSlashCommandsService
def to_param def to_param
'slack_slash_commands' 'slack_slash_commands'
end end
def presenter
Gitlab::ChatCommands::Presenters::Mattermost.new
end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment