MM-10412: Adds deleteBy prop to posts. (#8896)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
5992a729c5
Коммит
260d7a0f85
@@ -158,7 +158,7 @@ func (api *PluginAPI) CreatePost(post *model.Post) (*model.Post, *model.AppError
|
||||
}
|
||||
|
||||
func (api *PluginAPI) DeletePost(postId string) *model.AppError {
|
||||
_, err := api.app.DeletePost(postId)
|
||||
_, err := api.app.DeletePost(postId, api.id)
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
@@ -569,14 +569,14 @@ func (a *App) GetPostsAroundPost(postId, channelId string, offset, limit int, be
|
||||
}
|
||||
}
|
||||
|
||||
func (a *App) DeletePost(postId string) (*model.Post, *model.AppError) {
|
||||
func (a *App) DeletePost(postId, deleteByID string) (*model.Post, *model.AppError) {
|
||||
if result := <-a.Srv.Store.Post().GetSingle(postId); result.Err != nil {
|
||||
result.Err.StatusCode = http.StatusBadRequest
|
||||
return nil, result.Err
|
||||
} else {
|
||||
post := result.Data.(*model.Post)
|
||||
|
||||
if result := <-a.Srv.Store.Post().Delete(postId, model.GetMillis()); result.Err != nil {
|
||||
if result := <-a.Srv.Store.Post().Delete(postId, model.GetMillis(), deleteByID); result.Err != nil {
|
||||
return nil, result.Err
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user