chore: rename GlobalCommentCreator to AFWebUser to allow potential reuse

This commit is contained in:
Khor Shu Heng 2024-07-25 14:39:02 +08:00
parent f535950643
commit f71ac07ae7
2 changed files with 5 additions and 5 deletions

View File

@ -850,7 +850,7 @@ pub struct PublishCollabItem<Meta, Data> {
pub struct GlobalComments(pub Vec<GlobalComment>);
#[derive(Serialize, Deserialize, Debug)]
pub struct GlobalCommentCreator {
pub struct AFWebUser {
pub uid: Uuid,
pub name: String,
pub avatar_url: Option<String>,
@ -858,7 +858,7 @@ pub struct GlobalCommentCreator {
#[derive(Serialize, Deserialize, Debug)]
pub struct GlobalComment {
pub user: Option<GlobalCommentCreator>,
pub user: Option<AFWebUser>,
pub created_at: DateTime<Utc>,
pub last_updated_at: DateTime<Utc>,
pub content: String,

View File

@ -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