migrating perm delete by channel to sync (#10993)

Этот коммит содержится в:
Evan do Carmo
2019-05-29 08:55:03 -04:00
коммит произвёл Jesús Espino
родитель ca15690685
Коммит 42ac975c0e
5 изменённых файлов: 14 добавлений и 15 удалений

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

@@ -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 {