feat: add profile fields for local users

DB→domain→API→AP→frontend end-to-end. Fields stored as
JSONB, exposed via PATCH /users/me, serialized as AP
PropertyValue attachment. Editor in federation settings,
display on profile card.
This commit is contained in:
2026-05-29 13:54:25 +02:00
parent 14a869cc8d
commit 805bd9534f
19 changed files with 224 additions and 27 deletions

View File

@@ -47,6 +47,7 @@ pub struct UpdateProfileRequest {
pub avatar_url: Option<String>,
pub header_url: Option<String>,
pub custom_css: Option<String>,
pub profile_fields: Option<Vec<crate::responses::ProfileField>>,
}
#[derive(Deserialize, utoipa::ToSchema)]

View File

@@ -1,5 +1,5 @@
use chrono::{DateTime, Utc};
use serde::Serialize;
use serde::{Deserialize, Serialize};
use uuid::Uuid;
#[derive(Serialize, utoipa::ToSchema)]
@@ -19,6 +19,7 @@ pub struct UserResponse {
pub avatar_url: Option<String>,
pub header_url: Option<String>,
pub custom_css: Option<String>,
pub profile_fields: Vec<ProfileField>,
pub local: bool,
pub is_followed_by_viewer: bool,
#[serde(rename = "joinedAt")]
@@ -105,7 +106,7 @@ pub struct CreatedApiKeyResponse {
pub key: String,
}
#[derive(Serialize, Clone, utoipa::ToSchema)]
#[derive(Serialize, Deserialize, Clone, utoipa::ToSchema)]
#[serde(rename_all = "camelCase")]
pub struct ProfileField {
pub name: String,