From 02736d4df7cc3f55616b74477014b64f67810080 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Fri, 20 Oct 2023 10:38:28 -0400 Subject: [PATCH] Make sure my_vote is consistently missing if not voted. Fixes #3197 --- crates/api_common/src/post.rs | 1 + crates/db_views/src/post_view.rs | 6 ------ docker/docker-compose.yml | 2 +- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/crates/api_common/src/post.rs b/crates/api_common/src/post.rs index b93742bea..c7ee08983 100644 --- a/crates/api_common/src/post.rs +++ b/crates/api_common/src/post.rs @@ -47,6 +47,7 @@ pub struct GetPost { pub comment_id: Option, } +#[skip_serializing_none] #[derive(Debug, Serialize, Deserialize, Clone)] #[cfg_attr(feature = "full", derive(TS))] #[cfg_attr(feature = "full", ts(export))] diff --git a/crates/db_views/src/post_view.rs b/crates/db_views/src/post_view.rs index 82e830ac1..cacb8d71b 100644 --- a/crates/db_views/src/post_view.rs +++ b/crates/db_views/src/post_view.rs @@ -546,12 +546,6 @@ impl PostView { .read(pool, (post_id, my_person_id, is_mod_or_admin)) .await?; - // If a person is given, then my_vote, if None, should be 0, not null - // Necessary to differentiate between other person's votes - if my_person_id.is_some() && res.my_vote.is_none() { - res.my_vote = Some(0) - }; - Ok(res) } } diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index a61f25973..bd339aabb 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -55,7 +55,7 @@ services: lemmy-ui: # use "image" to pull down an already compiled lemmy-ui. make sure to comment out "build". - image: dessalines/lemmy-ui:0.18.4 + image: dessalines/lemmy-ui:0.19.0-rc.3 # platform: linux/x86_64 # no arm64 support. uncomment platform if using m1. # use "build" to build your local lemmy ui image for development. make sure to comment out "image". # run: docker compose up --build