PLT-3506 Added flagged posts functionality (#3679)
* Added flagged posts functionality * UI Improvements to flags (#3697) * Added flag functionality for mobile * Updating flagged text (#3699) * Add back button to RHS thread when coming from flagged posts * Updating position of flags (#3708) * Plt 3506 - Reverting flag position (#3724) * Revert "Updating position of flags (#3708)" This reverts commit aaa05632c5d9eda35a048300a5bd7e99584c5b58. * Fixing the icon in search * Help text and white space improvements (#3730) * Updatng help text and some white spacing. * Updating help text
Этот коммит содержится в:
коммит произвёл
enahum
родитель
9b50b50283
Коммит
0184d6059b
28
api/post.go
28
api/post.go
@@ -34,6 +34,7 @@ func InitPost() {
|
||||
l4g.Debug(utils.T("api.post.init.debug"))
|
||||
|
||||
BaseRoutes.NeedTeam.Handle("/posts/search", ApiUserRequired(searchPosts)).Methods("POST")
|
||||
BaseRoutes.NeedTeam.Handle("/posts/flagged/{offset:[0-9]+}/{limit:[0-9]+}", ApiUserRequiredActivity(getFlaggedPosts, false)).Methods("GET")
|
||||
BaseRoutes.NeedTeam.Handle("/posts/{post_id}", ApiUserRequired(getPostById)).Methods("GET")
|
||||
BaseRoutes.NeedTeam.Handle("/pltmp/{post_id}", ApiUserRequired(getPermalinkTmp)).Methods("GET")
|
||||
|
||||
@@ -1034,6 +1035,33 @@ func updatePost(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
}
|
||||
|
||||
func getFlaggedPosts(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
params := mux.Vars(r)
|
||||
|
||||
offset, err := strconv.Atoi(params["offset"])
|
||||
if err != nil {
|
||||
c.SetInvalidParam("getFlaggedPosts", "offset")
|
||||
return
|
||||
}
|
||||
|
||||
limit, err := strconv.Atoi(params["limit"])
|
||||
if err != nil {
|
||||
c.SetInvalidParam("getFlaggedPosts", "limit")
|
||||
return
|
||||
}
|
||||
|
||||
posts := &model.PostList{}
|
||||
|
||||
if result := <-Srv.Store.Post().GetFlaggedPosts(c.Session.UserId, offset, limit); result.Err != nil {
|
||||
c.Err = result.Err
|
||||
return
|
||||
} else {
|
||||
posts = result.Data.(*model.PostList)
|
||||
}
|
||||
|
||||
w.Write([]byte(posts.ToJson()))
|
||||
}
|
||||
|
||||
func getPosts(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
params := mux.Vars(r)
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user