]> Untitled Git - lemmy.git/blobdiff - crates/db_schema/src/impls/community.rs
Hide community v2 (#2055)
[lemmy.git] / crates / db_schema / src / impls / community.rs
index d2b0d9cdebfee641f9863ccb73f88ba352a311e5..43b7db3e29621a17a601a12e115c7a3d1d55ad0b 100644 (file)
@@ -43,6 +43,7 @@ mod safe_type {
     local,
     icon,
     banner,
+    hidden,
   );
 
   impl ToSafe for Community {
@@ -62,6 +63,7 @@ mod safe_type {
         local,
         icon,
         banner,
+        hidden,
       )
     }
   }
@@ -122,9 +124,9 @@ impl Community {
       .get_result::<Self>(conn)
   }
 
-  pub fn distinct_federated_communities(conn: &PgConnection) -> Result<Vec<String>, Error> {
+  pub fn distinct_federated_communities(conn: &PgConnection) -> Result<Vec<DbUrl>, Error> {
     use crate::schema::community::dsl::*;
-    community.select(actor_id).distinct().load::<String>(conn)
+    community.select(actor_id).distinct().load::<DbUrl>(conn)
   }
 
   pub fn upsert(conn: &PgConnection, community_form: &CommunityForm) -> Result<Community, Error> {
@@ -372,6 +374,7 @@ mod tests {
       followers_url: inserted_community.followers_url.to_owned(),
       inbox_url: inserted_community.inbox_url.to_owned(),
       shared_inbox_url: None,
+      hidden: false,
     };
 
     let community_follower_form = CommunityFollowerForm {