made the preference store GetCategory method sync (#10847)

* made the preference store GetCategory method sync

* fixed the review comments
Этот коммит содержится в:
Pradeep Murugesan
2019-05-15 15:56:42 +01:00
коммит произвёл Christopher Speller
родитель 2130e9f0b1
Коммит 24a02b4168
6 изменённых файлов: 38 добавлений и 31 удалений

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

@@ -33,11 +33,10 @@ func ptrBool(b bool) *bool {
}
func checkPreference(t *testing.T, a *App, userId string, category string, name string, value string) {
if res := <-a.Srv.Store.Preference().GetCategory(userId, category); res.Err != nil {
if preferences, err := a.Srv.Store.Preference().GetCategory(userId, category); err != nil {
debug.PrintStack()
t.Fatalf("Failed to get preferences for user %v with category %v", userId, category)
} else {
preferences := res.Data.(model.Preferences)
found := false
for _, preference := range preferences {
if preference.Name == name {