Make sure my_vote is consistently missing if not voted. Fixes #3197

This commit is contained in:
Dessalines 2023-10-20 10:38:28 -04:00
parent dfc74835b1
commit 02736d4df7
3 changed files with 2 additions and 7 deletions

View file

@ -47,6 +47,7 @@ pub struct GetPost {
pub comment_id: Option<CommentId>,
}
#[skip_serializing_none]
#[derive(Debug, Serialize, Deserialize, Clone)]
#[cfg_attr(feature = "full", derive(TS))]
#[cfg_attr(feature = "full", ts(export))]

View file

@ -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)
}
}

View file

@ -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