PLT-7818 Updates to post type (#7579)
* Updates to post type * Update tests
Этот коммит содержится в:
коммит произвёл
Chris
родитель
0da0cf1a21
Коммит
9adaf53e11
@@ -29,6 +29,11 @@ func (a *App) CreatePostAsUser(post *model.Post) (*model.Post, *model.AppError)
|
||||
channel = result.Data.(*model.Channel)
|
||||
}
|
||||
|
||||
if strings.HasPrefix(post.Type, model.POST_SYSTEM_MESSAGE_PREFIX) {
|
||||
err := model.NewAppError("CreatePostAsUser", "api.context.invalid_param.app_error", map[string]interface{}{"Name": "post.type"}, "", http.StatusBadRequest)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if channel.DeleteAt != 0 {
|
||||
err := model.NewAppError("createPost", "api.post.create_post.can_not_post_to_deleted.error", nil, "", http.StatusBadRequest)
|
||||
return nil, err
|
||||
|
||||
Ссылка в новой задаче
Block a user