From f71ac07ae76716be553a75b3e81fea3be0cbf5f6 Mon Sep 17 00:00:00 2001 From: Khor Shu Heng Date: Thu, 25 Jul 2024 14:39:02 +0800 Subject: [PATCH] chore: rename GlobalCommentCreator to AFWebUser to allow potential reuse --- libs/database-entity/src/dto.rs | 4 ++-- libs/database/src/workspace.rs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libs/database-entity/src/dto.rs b/libs/database-entity/src/dto.rs index 1d8786e7..42aa42a8 100644 --- a/libs/database-entity/src/dto.rs +++ b/libs/database-entity/src/dto.rs @@ -850,7 +850,7 @@ pub struct PublishCollabItem { pub struct GlobalComments(pub Vec); #[derive(Serialize, Deserialize, Debug)] -pub struct GlobalCommentCreator { +pub struct AFWebUser { pub uid: Uuid, pub name: String, pub avatar_url: Option, @@ -858,7 +858,7 @@ pub struct GlobalCommentCreator { #[derive(Serialize, Deserialize, Debug)] pub struct GlobalComment { - pub user: Option, + pub user: Option, pub created_at: DateTime, pub last_updated_at: DateTime, pub content: String, diff --git a/libs/database/src/workspace.rs b/libs/database/src/workspace.rs index f03d7276..5c5be795 100644 --- a/libs/database/src/workspace.rs +++ b/libs/database/src/workspace.rs @@ -1,6 +1,6 @@ use database_entity::dto::{ - AFRole, AFWorkspaceInvitation, AFWorkspaceInvitationStatus, AFWorkspaceSettings, GlobalComment, - GlobalCommentCreator, PublishCollabItem, PublishInfo, + AFRole, AFWebUser, AFWorkspaceInvitation, AFWorkspaceInvitationStatus, AFWorkspaceSettings, + GlobalComment, PublishCollabItem, PublishInfo, }; use futures_util::stream::BoxStream; use sqlx::{types::uuid, Executor, PgPool, Postgres, Transaction}; @@ -1111,7 +1111,7 @@ pub async fn select_comments_for_published_view<'a, E: Executor<'a, Database = P let result = rows .iter() .map(|row| { - let comment_creator = row.user_uuid.map(|uuid| GlobalCommentCreator { + let comment_creator = row.user_uuid.map(|uuid| AFWebUser { uid: uuid, name: row .user_name