fix some endpoints
This commit is contained in:
parent
7aee99ac42
commit
6f1b94c040
10 changed files with 47 additions and 41 deletions
|
@ -36,11 +36,12 @@ func (app *App) Home(w http.ResponseWriter, r *http.Request) (timelineResponse,
|
|||
posts, err := app.Timeline().Home(ctx, token.UserID, limit, before, after)
|
||||
if err != nil {
|
||||
log.Err(err).Msg("getting posts from database")
|
||||
return timelineResponse{}, err
|
||||
}
|
||||
|
||||
resp := timelineResponse{Posts: make([]api.Post, len(posts))}
|
||||
for i := range posts {
|
||||
resp.Posts[i] = api.DBPostToPost(posts[i].Post, posts[i].Blog)
|
||||
resp.Posts[i] = api.DBPostToPost(posts[i].Post, posts[i].Blog, posts[i].Account)
|
||||
}
|
||||
|
||||
return resp, nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue