From 230358fd2f7ace434f07d2630391d1b8274f6148 Mon Sep 17 00:00:00 2001 From: khorshuheng Date: Mon, 29 Jul 2024 16:04:54 +0800 Subject: [PATCH] fix: rename uid to uuid in AFWebUser struct for clarity --- libs/database-entity/src/dto.rs | 2 +- libs/database/src/workspace.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libs/database-entity/src/dto.rs b/libs/database-entity/src/dto.rs index ea6e40cd..d155d9ee 100644 --- a/libs/database-entity/src/dto.rs +++ b/libs/database-entity/src/dto.rs @@ -851,7 +851,7 @@ pub struct GlobalComments { #[derive(Serialize, Deserialize, Debug, Clone)] pub struct AFWebUser { - pub uid: Uuid, + pub uuid: Uuid, pub name: String, pub avatar_url: Option, } diff --git a/libs/database/src/workspace.rs b/libs/database/src/workspace.rs index 8d14cbd3..2e1b0123 100644 --- a/libs/database/src/workspace.rs +++ b/libs/database/src/workspace.rs @@ -1150,7 +1150,7 @@ pub async fn select_comments_for_published_view_orderd_by_recency< .iter() .map(|row| { let comment_creator = row.user_uuid.map(|uuid| AFWebUser { - uid: uuid, + uuid, name: row .user_name .as_ref() @@ -1268,7 +1268,7 @@ pub async fn select_reactions_for_published_view_ordered_by_reaction_type_creati .users .iter() .map(|u| AFWebUser { - uid: u.uuid, + uuid: u.uuid, name: u.name.clone(), avatar_url: None, }) @@ -1312,7 +1312,7 @@ pub async fn select_reactions_for_comment_ordered_by_reaction_type_creation_time .users .iter() .map(|u| AFWebUser { - uid: u.uuid, + uuid: u.uuid, name: u.name.clone(), avatar_url: None, })