mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-12-23 19:31:33 +00:00
For community_name API parameters, only search locally (fixes #1271)
This commit is contained in:
parent
eee394cf85
commit
1ba1e466f7
3 changed files with 11 additions and 1 deletions
|
@ -491,6 +491,9 @@ These expire after 10 minutes.
|
||||||
`GET /user/get_captcha`
|
`GET /user/get_captcha`
|
||||||
|
|
||||||
#### Get User Details
|
#### Get User Details
|
||||||
|
|
||||||
|
`username` can only be used for local users. To get details for a federated user, pass `user_id` instead.
|
||||||
|
|
||||||
##### Request
|
##### Request
|
||||||
```rust
|
```rust
|
||||||
{
|
{
|
||||||
|
@ -1549,6 +1552,8 @@ The main / frontpage community is `community_id: 0`.
|
||||||
|
|
||||||
Post listing types are `All, Subscribed, Community`
|
Post listing types are `All, Subscribed, Community`
|
||||||
|
|
||||||
|
`community_name` can only be used for local communities. To get posts for a federated community, pass `community_id` instead.
|
||||||
|
|
||||||
##### Request
|
##### Request
|
||||||
```rust
|
```rust
|
||||||
{
|
{
|
||||||
|
@ -1916,6 +1921,8 @@ Only a mod or admin can remove the comment.
|
||||||
|
|
||||||
Comment listing types are `All, Subscribed, Community`
|
Comment listing types are `All, Subscribed, Community`
|
||||||
|
|
||||||
|
`community_name` can only be used for local communities. To get posts for a federated community, pass `community_id` instead.
|
||||||
|
|
||||||
##### Request
|
##### Request
|
||||||
```rust
|
```rust
|
||||||
{
|
{
|
||||||
|
|
|
@ -239,7 +239,9 @@ impl<'a> CommentQueryBuilder<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(for_community_name) = self.for_community_name {
|
if let Some(for_community_name) = self.for_community_name {
|
||||||
query = query.filter(community_name.eq(for_community_name));
|
query = query
|
||||||
|
.filter(community_name.eq(for_community_name))
|
||||||
|
.filter(local.eq(true));
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(for_post_id) = self.for_post_id {
|
if let Some(for_post_id) = self.for_post_id {
|
||||||
|
|
|
@ -280,6 +280,7 @@ impl<'a> PostQueryBuilder<'a> {
|
||||||
if let Some(for_community_name) = self.for_community_name {
|
if let Some(for_community_name) = self.for_community_name {
|
||||||
query = query
|
query = query
|
||||||
.filter(community_name.eq(for_community_name))
|
.filter(community_name.eq(for_community_name))
|
||||||
|
.filter(local.eq(true))
|
||||||
.then_order_by(stickied.desc());
|
.then_order_by(stickied.desc());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue