Skip to content

Commit 0e65224

Browse files
authored
fix(profile): fix liked posts ordering (#102)
1 parent cd5a099 commit 0e65224

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/tweets/tweets.repository.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -782,6 +782,7 @@ export class TweetsRepository {
782782
'tweet.num_replies AS num_replies',
783783
'tweet.created_at AS created_at',
784784
'tweet.updated_at AS updated_at',
785+
'like.created_at AS liked_at',
785786
`json_build_object(
786787
'id', tweet.tweet_author_id,
787788
'username', tweet.username,
@@ -795,7 +796,7 @@ export class TweetsRepository {
795796
) AS user`,
796797
])
797798
.where('tweet.type != :type', { type: 'repost' })
798-
.orderBy('tweet.created_at', 'DESC')
799+
.orderBy('like.created_at', 'DESC')
799800
.addOrderBy('tweet.tweet_id', 'DESC')
800801
.limit(limit);
801802

@@ -812,7 +813,7 @@ export class TweetsRepository {
812813
query,
813814
cursor,
814815
'tweet',
815-
'created_at',
816+
'liked_at',
816817
'tweet_id'
817818
);
818819

0 commit comments

Comments
 (0)