migrating perm delete by channel to sync (#10993)
Этот коммит содержится в:
коммит произвёл
Jesús Espino
родитель
ca15690685
Коммит
42ac975c0e
@@ -452,12 +452,11 @@ func (s *SqlPostStore) PermanentDeleteByUser(userId string) store.StoreChannel {
|
||||
})
|
||||
}
|
||||
|
||||
func (s *SqlPostStore) PermanentDeleteByChannel(channelId string) store.StoreChannel {
|
||||
return store.Do(func(result *store.StoreResult) {
|
||||
if _, err := s.GetMaster().Exec("DELETE FROM Posts WHERE ChannelId = :ChannelId", map[string]interface{}{"ChannelId": channelId}); err != nil {
|
||||
result.Err = model.NewAppError("SqlPostStore.PermanentDeleteByChannel", "store.sql_post.permanent_delete_by_channel.app_error", nil, "channel_id="+channelId+", "+err.Error(), http.StatusInternalServerError)
|
||||
}
|
||||
})
|
||||
func (s *SqlPostStore) PermanentDeleteByChannel(channelId string) *model.AppError {
|
||||
if _, err := s.GetMaster().Exec("DELETE FROM Posts WHERE ChannelId = :ChannelId", map[string]interface{}{"ChannelId": channelId}); err != nil {
|
||||
return model.NewAppError("SqlPostStore.PermanentDeleteByChannel", "store.sql_post.permanent_delete_by_channel.app_error", nil, "channel_id="+channelId+", "+err.Error(), http.StatusInternalServerError)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *SqlPostStore) GetPosts(channelId string, offset int, limit int, allowFromCache bool) store.StoreChannel {
|
||||
|
||||
Ссылка в новой задаче
Block a user