diff options
author | Unknown <joe2010xtmf@163.com> | 2014-03-13 02:09:36 -0400 |
---|---|---|
committer | Unknown <joe2010xtmf@163.com> | 2014-03-13 02:09:36 -0400 |
commit | ea765d25e21a5e2ff67ff39891962f5f23facda8 (patch) | |
tree | 10635b6b10b06df8c01b7eba4c9215cd180caf4a /routers | |
parent | 3005a0f13e8861c79e3ea84ce480124fbc3c181d (diff) | |
download | gitea-ea765d25e21a5e2ff67ff39891962f5f23facda8.tar.gz gitea-ea765d25e21a5e2ff67ff39891962f5f23facda8.zip |
Update action struct
Diffstat (limited to 'routers')
-rw-r--r-- | routers/user/user.go | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/routers/user/user.go b/routers/user/user.go index ae9dd90290..59177a47b9 100644 --- a/routers/user/user.go +++ b/routers/user/user.go @@ -5,7 +5,6 @@ package user import ( - "bytes" "net/http" "github.com/codegangsta/martini" @@ -167,20 +166,10 @@ func Delete(data base.TmplData, req *http.Request, session sessions.Session, r r r.HTML(200, "user/delete", data) } -func Feeds(form auth.FeedsForm, r render.Render) string { +func Feeds(form auth.FeedsForm, r render.Render) { actions, err := models.GetFeeds(form.UserId, form.Offset) if err != nil { - return err.Error() + r.JSON(500, err) } - - length := len(actions) - buf := bytes.NewBuffer([]byte("[")) - for i, action := range actions { - buf.WriteString(action.Content) - if i < length-1 { - buf.WriteString(",") - } - } - buf.WriteString("]") - return buf.String() + r.JSON(200, actions) } |