Skip to content

Commit

Permalink
Change order by for paginated post
Browse files Browse the repository at this point in the history
  • Loading branch information
teodorus-nathaniel committed Jul 12, 2024
1 parent 57bed44 commit 2f92b7e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/services/datahub/posts/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ async function getPaginatedPostIdsByRootPostId({
rootPostId: postId,
approvedInRootPost: !onlyDisplayUnapprovedMessages,
},
orderBy: 'createdAtTime',
orderBy: onlyDisplayUnapprovedMessages
? 'createdAtTime'
: 'approvedInRootPostAtTime',
orderDirection: onlyDisplayUnapprovedMessages
? QueryOrder.Asc
: QueryOrder.Desc,
Expand Down

0 comments on commit 2f92b7e

Please sign in to comment.