Skip to content
This repository has been archived by the owner on Jun 13, 2023. It is now read-only.

Commit

Permalink
fix: respect the time range when getting top posts
Browse files Browse the repository at this point in the history
  • Loading branch information
thislooksfun committed May 17, 2023
1 parent b906235 commit cdba4cd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/reddit/subreddit/controls.ts
Expand Up @@ -420,7 +420,7 @@ export class SubredditControls extends BaseControls {
* @returns A listing of posts, with the top rated ones first.
*/
getTopPosts(subreddit?: string, time: TimeRange = "all"): Listing<Post> {
return this.getSortedPosts(subreddit, "top", { time });
return this.getSortedPosts(subreddit, "top", { t: time });
}

/**
Expand Down Expand Up @@ -469,7 +469,7 @@ export class SubredditControls extends BaseControls {
subreddit?: string,
time: TimeRange = "all"
): Listing<Post> {
return this.getSortedPosts(subreddit, "controversial", { time });
return this.getSortedPosts(subreddit, "controversial", { t: time });
}

/** @internal */
Expand Down

0 comments on commit cdba4cd

Please sign in to comment.