diff --git a/docs/openapi.yaml b/docs/openapi.yaml index b9a3dba..1175322 100644 --- a/docs/openapi.yaml +++ b/docs/openapi.yaml @@ -87,37 +87,9 @@ paths: $ref: '#/components/schemas/Account' 400: description: Invalid user data - /api/v1/directory: - get: - summary: List accounts visible in the directory. - parameters: - - name: offset - in: query - description: How many accounts to skip before returning results. - required: false - schema: - type: integer - default: 0 - - name: limit - in: query - description: How many accounts to load. - required: false - schema: - type: integer - default: 40 - responses: - 200: - description: Successful operation - content: - application/json: - schema: - description: Profile list - type: array - items: - $ref: '#/components/schemas/Account' /api/v1/accounts/{account_id}/statuses: get: - summary: Statuses posted to the given account. + summary: Posts created by the given actor. parameters: - $ref: '#/components/parameters/account_id' - name: max_id @@ -144,6 +116,8 @@ paths: type: array items: $ref: '#/components/schemas/Status' + 404: + description: Profile not found /api/v1/accounts/{account_id}/followers: get: summary: Actors which follow the given actor. @@ -236,6 +210,34 @@ paths: $ref: '#/components/schemas/Relationship' 404: description: Profile not found + /api/v1/directory: + get: + summary: List accounts visible in the directory. + parameters: + - name: offset + in: query + description: How many accounts to skip before returning results. + required: false + schema: + type: integer + default: 0 + - name: limit + in: query + description: How many accounts to load. + required: false + schema: + type: integer + default: 40 + responses: + 200: + description: Successful operation + content: + application/json: + schema: + description: Profile list + type: array + items: + $ref: '#/components/schemas/Account' /api/v1/statuses: post: summary: Create new post. diff --git a/src/mastodon_api/accounts/views.rs b/src/mastodon_api/accounts/views.rs index 1064b53..d34cc77 100644 --- a/src/mastodon_api/accounts/views.rs +++ b/src/mastodon_api/accounts/views.rs @@ -297,9 +297,10 @@ async fn get_account_statuses( Some(auth) => Some(get_current_user(db_client, auth.token()).await?), None => None, }; + let profile = get_profile_by_id(db_client, &account_id).await?; let mut posts = get_posts_by_author( db_client, - &account_id, + &profile.id, maybe_current_user.as_ref().map(|user| &user.id), false, query_params.max_id,