mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
[MM-15296] Migrate "Preference.Save" to Sync by default (#10866)
* response format changes * Generated mocks Fixed all references of Preferences.Save * Remove old code from store.go (incorrect merge) * Review change - Add validations on count and error * Review change - return from root level * Review change - return 0 as nil value for int * fix initialisation of err in preference_store
This commit is contained in:
committed by
Jesús Espino
parent
c05cf5b033
commit
fb6c1debf0
@@ -310,8 +310,8 @@ func (a *App) createUser(user *model.User) (*model.User, *model.AppError) {
|
||||
}
|
||||
|
||||
pref := model.Preference{UserId: ruser.Id, Category: model.PREFERENCE_CATEGORY_TUTORIAL_STEPS, Name: ruser.Id, Value: "0"}
|
||||
if presult := <-a.Srv.Store.Preference().Save(&model.Preferences{pref}); presult.Err != nil {
|
||||
mlog.Error(fmt.Sprintf("Encountered error saving tutorial preference, err=%v", presult.Err.Message))
|
||||
if _, err := a.Srv.Store.Preference().Save(&model.Preferences{pref}); err != nil {
|
||||
mlog.Error(fmt.Sprintf("Encountered error saving tutorial preference, err=%v", err.Message))
|
||||
}
|
||||
|
||||
ruser.Sanitize(map[string]bool{})
|
||||
|
||||
Reference in New Issue
Block a user