[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
Этот коммит содержится в:
Ishank Gulati
2019-05-26 18:36:33 +05:30
коммит произвёл Jesús Espino
родитель c05cf5b033
Коммит fb6c1debf0
15 изменённых файлов: 150 добавлений и 86 удалений

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

@@ -10,7 +10,6 @@ import (
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/model"
"github.com/mattermost/mattermost-server/store"
)
func TestReactionsOfPost(t *testing.T) {
@@ -81,7 +80,10 @@ func TestExportUserChannels(t *testing.T) {
}
var preferences model.Preferences
preferences = append(preferences, preference)
store.Must(th.App.Srv.Store.Preference().Save(&preferences))
count, err := th.App.Srv.Store.Preference().Save(&preferences)
require.Nil(t, err)
require.Equal(t, 1, count)
th.App.UpdateChannelMemberNotifyProps(notifyProps, channel.Id, user.Id)
exportData, err := th.App.buildUserChannelMemberships(user.Id, team.Id)
require.Nil(t, err)