mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
PLT-340 allow team directory and open invites
This commit is contained in:
@@ -280,8 +280,14 @@ func (s SqlTeamStore) GetAllTeamListing() StoreChannel {
|
||||
go func() {
|
||||
result := StoreResult{}
|
||||
|
||||
query := "SELECT * FROM Teams WHERE AllowTeamListing = 1"
|
||||
|
||||
if utils.Cfg.SqlSettings.DriverName == model.DATABASE_DRIVER_POSTGRES {
|
||||
query = "SELECT * FROM Teams WHERE AllowTeamListing = true"
|
||||
}
|
||||
|
||||
var data []*model.Team
|
||||
if _, err := s.GetReplica().Select(&data, "SELECT * FROM Teams WHERE AllowTeamListing = 1"); err != nil {
|
||||
if _, err := s.GetReplica().Select(&data, query); err != nil {
|
||||
result.Err = model.NewAppError("SqlTeamStore.GetAllTeams", "We could not get all teams", err.Error())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user