From 444d71e043eb19979ec1b08504b2760910cb2a47 Mon Sep 17 00:00:00 2001 From: "Z.J. van de Weg" Date: Mon, 20 Feb 2017 13:41:50 +0100 Subject: Transactional mattermost team creation Before this commit, but still on this feature branch, the creation of mattermost teams where a background job. However, it was decided it was better that these happened as transaction so feedback could be displayed to the user. --- lib/mattermost/team.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/mattermost') diff --git a/lib/mattermost/team.rb b/lib/mattermost/team.rb index d5648f7167f..52486fd1a54 100644 --- a/lib/mattermost/team.rb +++ b/lib/mattermost/team.rb @@ -7,20 +7,20 @@ module Mattermost # Creates a team on the linked Mattermost instance, the team admin will be the # `current_user` passed to the Mattermost::Client instance - def create(group, params) - session_post('/api/v3/teams/create', body: new_team_params(group, params).to_json) + def create(group) + session_post('/api/v3/teams/create', body: new_team_params(group).to_json) end private MATTERMOST_TEAM_LENGTH_MAX = 59 - def new_team_params(group, options) + def new_team_params(group) { name: group.path[0..MATTERMOST_TEAM_LENGTH_MAX], display_name: group.name[0..MATTERMOST_TEAM_LENGTH_MAX], type: group.public? ? 'O' : 'I' # Open vs Invite-only - }.merge(options) + } end end end -- cgit v1.2.3