MM-26410/MM-26825 Improve syncing between favorites category and preferences (#15048)
* MM-26410 Allow moving channels into Favorites when they're favorited in prefs * MM-26410 Fix management of Favorites category when updating preferences * MM-26410 Add management of Favorites category when deleting preferences * Address feedback 1 * Remove WHERE (1=1) from query * Remove unnecessary sq.Expr * Rewrite query to use left join * Remove redundant where statement and add some more tests * Fix linting issues * Rename addChannelToFavoritesCategory to addChannelToFavoritesCategory
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
7602dc0b19
Коммит
14aba9bccb
@@ -263,6 +263,20 @@ func (_m *ChannelStore) DeleteSidebarCategory(categoryId string) *model.AppError
|
||||
return r0
|
||||
}
|
||||
|
||||
// DeleteSidebarChannelsByPreferences provides a mock function with given fields: preferences
|
||||
func (_m *ChannelStore) DeleteSidebarChannelsByPreferences(preferences *model.Preferences) error {
|
||||
ret := _m.Called(preferences)
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(*model.Preferences) error); ok {
|
||||
r0 = rf(preferences)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// Get provides a mock function with given fields: id, allowFromCache
|
||||
func (_m *ChannelStore) Get(id string, allowFromCache bool) (*model.Channel, error) {
|
||||
ret := _m.Called(id, allowFromCache)
|
||||
@@ -2072,16 +2086,14 @@ func (_m *ChannelStore) UpdateSidebarChannelCategoryOnMove(channel *model.Channe
|
||||
}
|
||||
|
||||
// UpdateSidebarChannelsByPreferences provides a mock function with given fields: preferences
|
||||
func (_m *ChannelStore) UpdateSidebarChannelsByPreferences(preferences *model.Preferences) *model.AppError {
|
||||
func (_m *ChannelStore) UpdateSidebarChannelsByPreferences(preferences *model.Preferences) error {
|
||||
ret := _m.Called(preferences)
|
||||
|
||||
var r0 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(*model.Preferences) *model.AppError); ok {
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(*model.Preferences) error); ok {
|
||||
r0 = rf(preferences)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.AppError)
|
||||
}
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
|
||||
Ссылка в новой задаче
Block a user