]> Untitled Git - lemmy.git/blobdiff - crates/api_common/src/post.rs
First pass at adding comment trees. (#2362)
[lemmy.git] / crates / api_common / src / post.rs
index 8c05790e92c21f0ba6bc568fe1420af5fbcab1a0..4884c15dae60c6707e45c89733ea9b6070b75ee0 100644 (file)
@@ -1,10 +1,10 @@
 use crate::sensitive::Sensitive;
 use lemmy_db_schema::{
-  newtypes::{CommunityId, DbUrl, PostId, PostReportId},
+  newtypes::{CommentId, CommunityId, DbUrl, PostId, PostReportId},
   ListingType,
   SortType,
 };
-use lemmy_db_views::structs::{CommentView, PostReportView, PostView};
+use lemmy_db_views::structs::{PostReportView, PostView};
 use lemmy_db_views_actor::structs::{CommunityModeratorView, CommunityView};
 use serde::{Deserialize, Serialize};
 use url::Url;
@@ -27,7 +27,8 @@ pub struct PostResponse {
 
 #[derive(Debug, Serialize, Deserialize, Clone, Default)]
 pub struct GetPost {
-  pub id: PostId,
+  pub id: Option<PostId>,
+  pub comment_id: Option<CommentId>,
   pub auth: Option<Sensitive<String>>,
 }
 
@@ -35,7 +36,6 @@ pub struct GetPost {
 pub struct GetPostResponse {
   pub post_view: PostView,
   pub community_view: CommunityView,
-  pub comments: Vec<CommentView>,
   pub moderators: Vec<CommunityModeratorView>,
   pub online: usize,
 }