diff --git a/src/mastodon_api/accounts/types.rs b/src/mastodon_api/accounts/types.rs index e67d880..c0a7664 100644 --- a/src/mastodon_api/accounts/types.rs +++ b/src/mastodon_api/accounts/types.rs @@ -185,6 +185,14 @@ impl AccountUpdateData { } } +// TODO: actix currently doesn't support parameter arrays +// https://github.com/actix/actix-web/issues/2044 +#[derive(Deserialize)] +pub struct RelationshipQueryParams { + #[serde(rename(deserialize = "id[]"))] + pub id: Uuid, +} + fn default_page_size() -> i64 { 20 } #[derive(Deserialize)] diff --git a/src/mastodon_api/accounts/views.rs b/src/mastodon_api/accounts/views.rs index 89e1137..9771696 100644 --- a/src/mastodon_api/accounts/views.rs +++ b/src/mastodon_api/accounts/views.rs @@ -1,6 +1,5 @@ use actix_web::{get, post, patch, web, HttpResponse, Scope}; use actix_web_httpauth::extractors::bearer::BearerAuth; -use serde::Deserialize; use uuid::Uuid; use crate::activitypub::activity::{ @@ -53,6 +52,7 @@ use super::types::{ AccountCreateData, AccountUpdateData, FollowListQueryParams, + RelationshipQueryParams, StatusListQueryParams, }; @@ -227,14 +227,6 @@ async fn authorize_subscription( Ok(HttpResponse::Ok().json(signature)) } -// TODO: actix currently doesn't support parameter arrays -// https://github.com/actix/actix-web/issues/2044 -#[derive(Deserialize)] -pub struct RelationshipQueryParams { - #[serde(rename(deserialize = "id[]"))] - id: Uuid, -} - #[get("/relationships")] async fn get_relationships_view( auth: BearerAuth,