summaryrefslogtreecommitdiffstats
path: root/server/src/api/post.rs
diff options
context:
space:
mode:
authorDessalines <tyhou13@gmx.com>2020-02-02 12:45:41 -0500
committerDessalines <tyhou13@gmx.com>2020-02-02 12:45:41 -0500
commit96a7e99e57f8c79eead599e6de5d94016f7021e6 (patch)
tree3447364e73f461660c0db87cd2f45ddea16a50ee /server/src/api/post.rs
parentcda1e6e74141efea556e81082a3468a012d2926d (diff)
Removing PostLikeResponse in favor of PostResponse. Consolidating comment and post_sends.
Diffstat (limited to 'server/src/api/post.rs')
-rw-r--r--server/src/api/post.rs11
1 files changed, 3 insertions, 8 deletions
diff --git a/server/src/api/post.rs b/server/src/api/post.rs
index 642521eb..086705bc 100644
--- a/server/src/api/post.rs
+++ b/server/src/api/post.rs
@@ -55,11 +55,6 @@ pub struct CreatePostLike {
auth: String,
}
-#[derive(Serialize, Deserialize, Clone)]
-pub struct CreatePostLikeResponse {
- pub post: PostView,
-}
-
#[derive(Serialize, Deserialize)]
pub struct EditPost {
pub edit_id: i32,
@@ -242,8 +237,8 @@ impl Perform<GetPostsResponse> for Oper<GetPosts> {
}
}
-impl Perform<CreatePostLikeResponse> for Oper<CreatePostLike> {
- fn perform(&self, conn: &PgConnection) -> Result<CreatePostLikeResponse, Error> {
+impl Perform<PostResponse> for Oper<CreatePostLike> {
+ fn perform(&self, conn: &PgConnection) -> Result<PostResponse, Error> {
let data: &CreatePostLike = &self.data;
let claims = match Claims::decode(&data.auth) {
@@ -296,7 +291,7 @@ impl Perform<CreatePostLikeResponse> for Oper<CreatePostLike> {
};
// just output the score
- Ok(CreatePostLikeResponse { post: post_view })
+ Ok(PostResponse { post: post_view })
}
}