diff options
author | Andrei Stanciu <andrei.stanciu@geminisols.ro> | 2017-02-28 10:41:38 +0200 |
---|---|---|
committer | George Goldberg <george@gberg.me> | 2017-02-28 08:41:38 +0000 |
commit | 45edfbe719b87bc6207f88350ff501eff142b28c (patch) | |
tree | 30dac4de7c3b43ce9b2ec2160e8c993cc9c4e764 /app/team.go | |
parent | 83c113595ace467ad34f05e35fb2282fa8631a17 (diff) | |
download | chat-45edfbe719b87bc6207f88350ff501eff142b28c.tar.gz chat-45edfbe719b87bc6207f88350ff501eff142b28c.tar.bz2 chat-45edfbe719b87bc6207f88350ff501eff142b28c.zip |
Get all teams api4 (#5542)
Diffstat (limited to 'app/team.go')
-rw-r--r-- | app/team.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/app/team.go b/app/team.go index 0c0a6a4da..b1e0f1362 100644 --- a/app/team.go +++ b/app/team.go @@ -327,6 +327,14 @@ func GetAllTeams() ([]*model.Team, *model.AppError) { } } +func GetAllTeamsPage(offset int, limit int) ([]*model.Team, *model.AppError) { + if result := <-Srv.Store.Team().GetAllPage(offset, limit); result.Err != nil { + return nil, result.Err + } else { + return result.Data.([]*model.Team), nil + } +} + func GetAllOpenTeams() ([]*model.Team, *model.AppError) { if result := <-Srv.Store.Team().GetAllTeamListing(); result.Err != nil { return nil, result.Err @@ -335,6 +343,14 @@ func GetAllOpenTeams() ([]*model.Team, *model.AppError) { } } +func GetAllOpenTeamsPage(offset int, limit int) ([]*model.Team, *model.AppError) { + if result := <-Srv.Store.Team().GetAllTeamPageListing(offset, limit); result.Err != nil { + return nil, result.Err + } else { + return result.Data.([]*model.Team), nil + } +} + func GetTeamsForUser(userId string) ([]*model.Team, *model.AppError) { if result := <-Srv.Store.Team().GetTeamsByUserId(userId); result.Err != nil { return nil, result.Err |