Migrate "Channel.PermanentDeleteMembersByUser" to Sync by default (#11243)
* Change PermanentDeleteMembersByUser to sync by default * Address comments
Этот коммит содержится в:
коммит произвёл
Jesús Espino
родитель
4cf6ae6808
Коммит
879883e9a3
@@ -1717,12 +1717,11 @@ func (s SqlChannelStore) RemoveAllDeactivatedMembers(channelId string) *model.Ap
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s SqlChannelStore) PermanentDeleteMembersByUser(userId string) store.StoreChannel {
|
||||
return store.Do(func(result *store.StoreResult) {
|
||||
if _, err := s.GetMaster().Exec("DELETE FROM ChannelMembers WHERE UserId = :UserId", map[string]interface{}{"UserId": userId}); err != nil {
|
||||
result.Err = model.NewAppError("SqlChannelStore.RemoveMember", "store.sql_channel.permanent_delete_members_by_user.app_error", nil, "user_id="+userId+", "+err.Error(), http.StatusInternalServerError)
|
||||
}
|
||||
})
|
||||
func (s SqlChannelStore) PermanentDeleteMembersByUser(userId string) *model.AppError {
|
||||
if _, err := s.GetMaster().Exec("DELETE FROM ChannelMembers WHERE UserId = :UserId", map[string]interface{}{"UserId": userId}); err != nil {
|
||||
return model.NewAppError("SqlChannelStore.RemoveMember", "store.sql_channel.permanent_delete_members_by_user.app_error", nil, "user_id="+userId+", "+err.Error(), http.StatusInternalServerError)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s SqlChannelStore) UpdateLastViewedAt(channelIds []string, userId string) (map[string]int64, *model.AppError) {
|
||||
|
||||
Ссылка в новой задаче
Block a user