Remove searcher from arguments of Post::insert()

This commit is contained in:
Kitaiti Makoto 2021-01-07 22:20:55 +09:00
parent 6a2ba2260d
commit 6ad3359609
3 changed files with 1 additions and 7 deletions

View file

@ -63,7 +63,7 @@ impl Post {
find_by!(posts, find_by_ap_url, ap_url as &str);
last!(posts);
pub fn insert(conn: &Connection, new: NewPost, _searcher: &Searcher) -> Result<Self> {
pub fn insert(conn: &Connection, new: NewPost) -> Result<Self> {
diesel::insert_into(posts::table)
.values(new)
.execute(conn)?;
@ -571,7 +571,6 @@ impl FromId<PlumeRocket> for Post {
fn from_activity(c: &PlumeRocket, article: LicensedArticle) -> Result<Self> {
let conn = &*c.conn;
let searcher = &c.searcher;
let license = article.custom_props.license_string().unwrap_or_default();
let article = article.object;
@ -619,7 +618,6 @@ impl FromId<PlumeRocket> for Post {
source: article.ap_object_props.source_object::<Source>()?.content,
cover_id: cover,
},
searcher,
)?;
for author in authors {
@ -864,7 +862,6 @@ mod tests {
source: "Hello".into(),
cover_id: None,
},
&r.searcher,
)
.unwrap();
PostAuthor::insert(

View file

@ -105,7 +105,6 @@ pub fn create(
rockets: PlumeRocket,
) -> Api<PostData> {
let conn = &*rockets.conn;
let search = &rockets.searcher;
let worker = &rockets.worker;
let author = User::get(conn, auth.0.user_id)?;
@ -155,7 +154,6 @@ pub fn create(
source: payload.source.clone(),
cover_id: payload.cover_id,
},
search,
)?;
PostAuthor::insert(

View file

@ -481,7 +481,6 @@ pub fn create(
source: form.content.clone(),
cover_id: form.cover,
},
&rockets.searcher,
)
.expect("post::create: post save error");