Skip to content

Commit

Permalink
feat(server/twitter): fix ordering of tweets
Browse files Browse the repository at this point in the history
  • Loading branch information
itschip committed Dec 1, 2021
1 parent bf00086 commit 8f4e1d8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions resources/server/twitter/twitter.db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class _TwitterDB {
const query = `
SELECT ${SELECT_FIELDS}
FROM (
SELECT * FROM npwd_twitter_tweets ORDER BY id DESC LIMIT ${TWEETS_PER_PAGE} OFFSET ${
SELECT * FROM npwd_twitter_tweets LIMIT ${TWEETS_PER_PAGE} OFFSET ${
TWEETS_PER_PAGE * currPage
}
) npwd_twitter_tweets
Expand All @@ -60,7 +60,7 @@ export class _TwitterDB {
LEFT OUTER JOIN npwd_twitter_tweets AS retweets ON retweets.id = npwd_twitter_tweets.retweet
LEFT OUTER JOIN npwd_twitter_profiles AS retweets_profiles
ON retweets.identifier = retweets_profiles.identifier
WHERE npwd_twitter_tweets.visible = 1
WHERE npwd_twitter_tweets.visible = 1 ORDER BY id DESC
`;
const [results] = await DbInterface._rawExec(query, [profileId, profileId]);
const tweets = <Tweet[]>results;
Expand Down

0 comments on commit 8f4e1d8

Please sign in to comment.