chore: rename GlobalCommentCreator to AFWebUser to allow potential reuse
This commit is contained in:
parent
f535950643
commit
f71ac07ae7
|
|
@ -850,7 +850,7 @@ pub struct PublishCollabItem<Meta, Data> {
|
||||||
pub struct GlobalComments(pub Vec<GlobalComment>);
|
pub struct GlobalComments(pub Vec<GlobalComment>);
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug)]
|
#[derive(Serialize, Deserialize, Debug)]
|
||||||
pub struct GlobalCommentCreator {
|
pub struct AFWebUser {
|
||||||
pub uid: Uuid,
|
pub uid: Uuid,
|
||||||
pub name: String,
|
pub name: String,
|
||||||
pub avatar_url: Option<String>,
|
pub avatar_url: Option<String>,
|
||||||
|
|
@ -858,7 +858,7 @@ pub struct GlobalCommentCreator {
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug)]
|
#[derive(Serialize, Deserialize, Debug)]
|
||||||
pub struct GlobalComment {
|
pub struct GlobalComment {
|
||||||
pub user: Option<GlobalCommentCreator>,
|
pub user: Option<AFWebUser>,
|
||||||
pub created_at: DateTime<Utc>,
|
pub created_at: DateTime<Utc>,
|
||||||
pub last_updated_at: DateTime<Utc>,
|
pub last_updated_at: DateTime<Utc>,
|
||||||
pub content: String,
|
pub content: String,
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
use database_entity::dto::{
|
use database_entity::dto::{
|
||||||
AFRole, AFWorkspaceInvitation, AFWorkspaceInvitationStatus, AFWorkspaceSettings, GlobalComment,
|
AFRole, AFWebUser, AFWorkspaceInvitation, AFWorkspaceInvitationStatus, AFWorkspaceSettings,
|
||||||
GlobalCommentCreator, PublishCollabItem, PublishInfo,
|
GlobalComment, PublishCollabItem, PublishInfo,
|
||||||
};
|
};
|
||||||
use futures_util::stream::BoxStream;
|
use futures_util::stream::BoxStream;
|
||||||
use sqlx::{types::uuid, Executor, PgPool, Postgres, Transaction};
|
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
|
let result = rows
|
||||||
.iter()
|
.iter()
|
||||||
.map(|row| {
|
.map(|row| {
|
||||||
let comment_creator = row.user_uuid.map(|uuid| GlobalCommentCreator {
|
let comment_creator = row.user_uuid.map(|uuid| AFWebUser {
|
||||||
uid: uuid,
|
uid: uuid,
|
||||||
name: row
|
name: row
|
||||||
.user_name
|
.user_name
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue