diff --git a/libs/database-entity/src/dto.rs b/libs/database-entity/src/dto.rs
index 42aa42a8..f3363d13 100644
--- a/libs/database-entity/src/dto.rs
+++ b/libs/database-entity/src/dto.rs
@@ -847,7 +847,9 @@ pub struct PublishCollabItem {
}
#[derive(Serialize, Deserialize, Debug)]
-pub struct GlobalComments(pub Vec);
+pub struct GlobalComments {
+ pub comments: Vec,
+}
#[derive(Serialize, Deserialize, Debug)]
pub struct AFWebUser {
diff --git a/src/api/workspace.rs b/src/api/workspace.rs
index b70a2eef..91a3fcab 100644
--- a/src/api/workspace.rs
+++ b/src/api/workspace.rs
@@ -1103,7 +1103,7 @@ async fn get_published_collab_comment_handler(
) -> Result> {
let view_id = view_id.into_inner();
let comments = get_comments_on_published_view(&state.pg_pool, &view_id).await?;
- let resp = GlobalComments(comments);
+ let resp = GlobalComments { comments };
Ok(Json(AppResponse::Ok().with_data(resp)))
}
diff --git a/tests/workspace/publish.rs b/tests/workspace/publish.rs
index e6d6c3b4..96617181 100644
--- a/tests/workspace/publish.rs
+++ b/tests/workspace/publish.rs
@@ -271,19 +271,19 @@ async fn test_publish_comments() {
.get_published_view_comments(&view_id)
.await
.unwrap()
- .0;
+ .comments;
assert_eq!(published_view_comments.len(), 2);
let published_view_comments: Vec = first_user_client
.get_published_view_comments(&view_id)
.await
.unwrap()
- .0;
+ .comments;
assert_eq!(published_view_comments.len(), 2);
let mut published_view_comments: Vec = guest_client
.get_published_view_comments(&view_id)
.await
.unwrap()
- .0;
+ .comments;
assert_eq!(published_view_comments.len(), 2);
assert!(published_view_comments.iter().all(|c| !c.is_deleted));
@@ -327,7 +327,7 @@ async fn test_publish_comments() {
.get_published_view_comments(&view_id)
.await
.unwrap()
- .0;
+ .comments;
published_view_comments.sort_by_key(|c| c.created_at);
let comment_creators = published_view_comments
.iter()
@@ -374,7 +374,7 @@ async fn test_publish_comments() {
.get_published_view_comments(&view_id)
.await
.unwrap()
- .0;
+ .comments;
published_view_comments.sort_by_key(|c| c.created_at);
assert_eq!(
published_view_comments
@@ -400,7 +400,7 @@ async fn test_publish_comments() {
.get_published_view_comments(&view_id)
.await
.unwrap()
- .0;
+ .comments;
assert_eq!(published_view_comments.len(), 3);
assert!(published_view_comments.iter().all(|c| c.is_deleted));
}