* Add tear down to APIv4 tests

* Defer tear downs
Этот коммит содержится в:
Joram Wilander
2017-02-02 11:46:42 -05:00
коммит произвёл Harrison Healey
родитель 60be5c902f
Коммит 365514174e
13 изменённых файлов: 194 добавлений и 2 удалений

Просмотреть файл

@@ -236,6 +236,27 @@ func (s SqlTeamStore) GetByName(name string) StoreChannel {
return storeChannel
}
func (s SqlTeamStore) SearchByName(name string) StoreChannel {
storeChannel := make(StoreChannel, 1)
go func() {
result := StoreResult{}
var teams []*model.Team
if _, err := s.GetReplica().Select(&teams, "SELECT * FROM Teams WHERE Name LIKE :Name", map[string]interface{}{"Name": name + "%"}); err != nil {
result.Err = model.NewLocAppError("SqlTeamStore.SearchByName", "store.sql_team.get_by_name.app_error", nil, "name="+name+", "+err.Error())
}
result.Data = teams
storeChannel <- result
close(storeChannel)
}()
return storeChannel
}
func (s SqlTeamStore) GetAll() StoreChannel {
storeChannel := make(StoreChannel, 1)