community.select(actor_id).distinct().load::<String>(conn)
}
- pub fn read_from_followers_url(
- conn: &PgConnection,
- followers_url_: &DbUrl,
- ) -> Result<Community, Error> {
- use crate::schema::community::dsl::*;
- community
- .filter(followers_url.eq(followers_url_))
- .first::<Self>(conn)
- }
-
pub fn upsert(conn: &PgConnection, community_form: &CommunityForm) -> Result<Community, Error> {
use crate::schema::community::dsl::*;
insert_into(community)
let new_community = CommunityForm {
name: "TIL".into(),
title: "nada".to_owned(),
+ public_key: "nada".to_owned(),
..CommunityForm::default()
};
actor_id: inserted_community.actor_id.to_owned(),
local: true,
private_key: None,
- public_key: None,
+ public_key: "nada".to_owned(),
last_refreshed_at: inserted_community.published,
icon: None,
banner: None,