From ea765d25e21a5e2ff67ff39891962f5f23facda8 Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 13 Mar 2014 02:09:36 -0400 Subject: Update action struct --- routers/user/user.go | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) (limited to 'routers') 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) } -- cgit v1.2.3