From 47d478790742a8876af187b34b766b0e8a772bf5 Mon Sep 17 00:00:00 2001 From: Brian Picciano Date: Fri, 20 May 2022 17:31:44 -0600 Subject: Always return results in time desc order from PostStore --- srv/src/http/posts.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'srv/src/http/posts.go') diff --git a/srv/src/http/posts.go b/srv/src/http/posts.go index 816e361..e1ddf80 100644 --- a/srv/src/http/posts.go +++ b/srv/src/http/posts.go @@ -69,11 +69,11 @@ func (a *api) postToPostTplPayload(storedPost post.StoredPost) (postTplPayload, } if !foundThis { - tplPayload.SeriesPrevious = &seriesPost + tplPayload.SeriesNext = &seriesPost continue } - tplPayload.SeriesNext = &seriesPost + tplPayload.SeriesPrevious = &seriesPost break } } @@ -138,7 +138,7 @@ func (a *api) renderPostsIndexHandler() http.Handler { return } - posts, hasMore, err := a.params.PostStore.WithOrderDesc().Get(page, pageCount) + posts, hasMore, err := a.params.PostStore.Get(page, pageCount) if err != nil { apiutil.InternalServerError( rw, r, fmt.Errorf("fetching page %d of posts: %w", page, err), -- cgit v1.2.3