* Updates to post type

* Update tests
Этот коммит содержится в:
Joram Wilander
2017-10-09 13:30:48 -04:00
коммит произвёл Chris
родитель 0da0cf1a21
Коммит 9adaf53e11
7 изменённых файлов: 58 добавлений и 6 удалений

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

@@ -41,6 +41,11 @@ func (a *App) CreateCommandPost(post *model.Post, teamId string, response *model
post.Message = parseSlackLinksToMarkdown(response.Text)
post.CreateAt = model.GetMillis()
if strings.HasPrefix(post.Type, model.POST_SYSTEM_MESSAGE_PREFIX) {
err := model.NewAppError("CreateCommandPost", "api.context.invalid_param.app_error", map[string]interface{}{"Name": "post.type"}, "", http.StatusBadRequest)
return nil, err
}
if response.Attachments != nil {
parseSlackAttachment(post, response.Attachments)
}