diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-12-20 00:22:10 +0100 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-12-20 00:22:10 +0100 |
commit | 841960f847f04da9c427bcdb19037e2112a90890 (patch) | |
tree | ff485924db7614a01d5f3f52f66dd28056097ff8 /lib/mattermost/team.rb | |
parent | 34295036e2a9ecf18ca5440a5dd6dbb0c7f05643 (diff) | |
download | gitlab-ce-841960f847f04da9c427bcdb19037e2112a90890.tar.gz |
Fix flow
Diffstat (limited to 'lib/mattermost/team.rb')
-rw-r--r-- | lib/mattermost/team.rb | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/lib/mattermost/team.rb b/lib/mattermost/team.rb index 2de01eced0b..784eca6ab5a 100644 --- a/lib/mattermost/team.rb +++ b/lib/mattermost/team.rb @@ -1,15 +1,7 @@ module Mattermost - class Team - def self.all(session) - response = session.get('/api/v3/teams/all') - - if response.success? - response.parsed_response - elsif response.parsed_response.try(:has_key?, 'message') - raise response.parsed_response['message'] - else - raise 'Failed to list teams' - end + class Team < Client + def all + json_get('/api/v3/teams/all') end end end |