feat: include avatar_url and banner_url in UserProfileResponse
This commit is contained in:
@@ -66,6 +66,10 @@ pub struct UserTrendsDto {
|
|||||||
pub struct UserProfileResponse {
|
pub struct UserProfileResponse {
|
||||||
pub user_id: Uuid,
|
pub user_id: Uuid,
|
||||||
pub username: String,
|
pub username: String,
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
|
pub avatar_url: Option<String>,
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
|
pub banner_url: Option<String>,
|
||||||
pub stats: UserStatsDto,
|
pub stats: UserStatsDto,
|
||||||
pub following_count: usize,
|
pub following_count: usize,
|
||||||
pub followers_count: usize,
|
pub followers_count: usize,
|
||||||
|
|||||||
@@ -1120,6 +1120,8 @@ pub async fn get_user_profile(
|
|||||||
Json(UserProfileResponse {
|
Json(UserProfileResponse {
|
||||||
user_id,
|
user_id,
|
||||||
username: user.username().value().to_string(),
|
username: user.username().value().to_string(),
|
||||||
|
avatar_url: user.avatar_path().map(|s| s.to_string()),
|
||||||
|
banner_url: user.banner_path().map(|s| s.to_string()),
|
||||||
stats: UserStatsDto {
|
stats: UserStatsDto {
|
||||||
total_movies: profile.stats.total_movies,
|
total_movies: profile.stats.total_movies,
|
||||||
avg_rating: profile.stats.avg_rating,
|
avg_rating: profile.stats.avg_rating,
|
||||||
|
|||||||
Reference in New Issue
Block a user