Implement some post endpoints for APIv4 (#5353)
* Implement POST /posts endpoint for APIv4
* Implement GET /channels/{channel_id}/posts endpoint for APIv4
* Implement GET /posts/{post_id} endpoint for APIv4
* Implement GET /posts/{post_id}/thread endpoint for APIv4
* Skip team get if it's a DM channel in handlePostEvents
Этот коммит содержится в:
коммит произвёл
Corey Hulen
родитель
260f1111e8
Коммит
e4effd0c15
@@ -375,6 +375,17 @@ func (c *Context) RequireUsername() *Context {
|
||||
return c
|
||||
}
|
||||
|
||||
func (c *Context) RequirePostId() *Context {
|
||||
if c.Err != nil {
|
||||
return c
|
||||
}
|
||||
|
||||
if len(c.Params.PostId) != 26 {
|
||||
c.SetInvalidUrlParam("post_id")
|
||||
}
|
||||
return c
|
||||
}
|
||||
|
||||
func (c *Context) RequireEmail() *Context {
|
||||
if c.Err != nil {
|
||||
return c
|
||||
|
||||
Ссылка в новой задаче
Block a user