}
if self.saved_only.unwrap_or(false) {
- query = query.filter(comment_saved::id.is_not_null());
+ query = query.filter(comment_saved::comment_id.is_not_null());
}
if !self.show_deleted_and_removed.unwrap_or(true) {
if self.local_user.is_some() {
// Filter out the rows with missing languages
- query = query.filter(local_user_language::id.is_not_null());
+ query = query.filter(local_user_language::language_id.is_not_null());
// Don't show blocked communities or persons
query = query.filter(community_block::person_id.is_null());
.await
.unwrap();
- let finnish_id = Language::read_id_from_code(pool, "fi").await.unwrap();
+ let finnish_id = Language::read_id_from_code(pool, Some("fi"))
+ .await
+ .unwrap()
+ .unwrap();
let comment_form_2 = CommentInsertForm::builder()
.content("Comment 2".into())
.creator_id(inserted_person.id)
.await
.unwrap();
- let polish_id = Language::read_id_from_code(pool, "pl").await.unwrap();
+ let polish_id = Language::read_id_from_code(pool, Some("pl"))
+ .await
+ .unwrap()
+ .unwrap();
let comment_form_4 = CommentInsertForm::builder()
.content("Comment 4".into())
.creator_id(inserted_person.id)
assert_eq!(5, all_languages.len());
// change user lang to finnish, should only show single finnish comment
- let finnish_id = Language::read_id_from_code(pool, "fi").await.unwrap();
+ let finnish_id = Language::read_id_from_code(pool, Some("fi"))
+ .await
+ .unwrap()
+ .unwrap();
LocalUserLanguage::update(pool, vec![finnish_id], data.inserted_local_user.id)
.await
.unwrap();
assert_eq!(finnish_id, finnish_comment[0].comment.language_id);
// now show all comments with undetermined language (which is the default value)
- let undetermined_id = Language::read_id_from_code(pool, "und").await.unwrap();
+ let undetermined_id = Language::read_id_from_code(pool, Some("und"))
+ .await
+ .unwrap()
+ .unwrap();
LocalUserLanguage::update(pool, vec![undetermined_id], data.inserted_local_user.id)
.await
.unwrap();
removed: false,
deleted: false,
locked: false,
- stickied: false,
nsfw: false,
embed_title: None,
embed_description: None,
ap_id: data.inserted_post.ap_id.clone(),
local: true,
language_id: Default::default(),
+ featured_community: false,
+ featured_local: false,
},
community: CommunitySafe {
id: data.inserted_community.id,