* modify Get method in preference_store * modify interface to match changes on preference store Get method * modify variable initialization * fix behavior on GetPreferenceByCategoryAndNameForUser
Этот коммит содержится в:
коммит произвёл
Miguel de la Cruz
родитель
b3e09715df
Коммит
a68ad55151
@@ -32,13 +32,12 @@ func (a *App) GetPreferenceByCategoryForUser(userId string, category string) (mo
|
||||
}
|
||||
|
||||
func (a *App) GetPreferenceByCategoryAndNameForUser(userId string, category string, preferenceName string) (*model.Preference, *model.AppError) {
|
||||
result := <-a.Srv.Store.Preference().Get(userId, category, preferenceName)
|
||||
if result.Err != nil {
|
||||
result.Err.StatusCode = http.StatusBadRequest
|
||||
return nil, result.Err
|
||||
res, err := a.Srv.Store.Preference().Get(userId, category, preferenceName)
|
||||
if err != nil {
|
||||
err.StatusCode = http.StatusBadRequest
|
||||
return nil, err
|
||||
}
|
||||
data := result.Data.(model.Preference)
|
||||
return &data, nil
|
||||
return res, nil
|
||||
}
|
||||
|
||||
func (a *App) UpdatePreferences(userId string, preferences model.Preferences) *model.AppError {
|
||||
|
||||
Ссылка в новой задаче
Block a user