Skip to content

Commit

Permalink
Merge branch '89-pages-only-loading-10-posts' into 'chapo-dev'
Browse files Browse the repository at this point in the history
added page and limit back to postquerybuilder

Closes #89

See merge request chapo-sandbox/lemmy!162
  • Loading branch information
Ned Sheqtic committed Jul 12, 2020
2 parents 2bc1fc8 + 6c21fe4 commit e6faec3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions server/src/api/post.rs
Original file line number Diff line number Diff line change
Expand Up @@ -358,10 +358,10 @@ impl Perform for Oper<GetPosts> {
Some(claims) => claims.show_nsfw,
None => false,
};

let page = data.page;
let type_ = ListingType::from_str(&data.type_)?;
let sort = SortType::from_str(&data.sort)?;

let limit = data.limit;
let community_id = data.community_id;
let posts = match blocking(pool, move |conn| {
PostQueryBuilder::create(conn)
Expand All @@ -370,6 +370,8 @@ impl Perform for Oper<GetPosts> {
.show_nsfw(show_nsfw)
.for_community_id(community_id)
.my_user_id(user_id)
.page(page)
.limit(limit)
.list()
})
.await?
Expand Down

0 comments on commit e6faec3

Please sign in to comment.