Add exclude_replies query parameter to /accounts/:id/statuses API method
This commit is contained in:
parent
94bd5bdbb5
commit
2a22a0bedd
3 changed files with 13 additions and 1 deletions
|
@ -199,6 +199,13 @@ paths:
|
|||
summary: Posts created by the given actor.
|
||||
parameters:
|
||||
- $ref: '#/components/parameters/account_id'
|
||||
- name: exclude_replies
|
||||
in: query
|
||||
description: Exclude replies from results.
|
||||
required: false
|
||||
schema:
|
||||
type: boolean
|
||||
default: true
|
||||
- name: max_id
|
||||
in: query
|
||||
description: Return results older than this ID.
|
||||
|
|
|
@ -282,8 +282,13 @@ pub struct FollowData {
|
|||
|
||||
fn default_page_size() -> i64 { 20 }
|
||||
|
||||
fn default_exclude_replies() -> bool { true }
|
||||
|
||||
#[derive(Deserialize)]
|
||||
pub struct StatusListQueryParams {
|
||||
#[serde(default = "default_exclude_replies")]
|
||||
pub exclude_replies: bool,
|
||||
|
||||
#[serde(default)]
|
||||
pub pinned: bool,
|
||||
|
||||
|
|
|
@ -430,7 +430,7 @@ async fn get_account_statuses(
|
|||
db_client,
|
||||
&profile.id,
|
||||
maybe_current_user.as_ref().map(|user| &user.id),
|
||||
false,
|
||||
!query_params.exclude_replies,
|
||||
true,
|
||||
query_params.max_id,
|
||||
query_params.limit,
|
||||
|
|
Loading…
Reference in a new issue