Remove searcher from arguments of Post::delete() and dependented methods

This commit is contained in:
Kitaiti Makoto
2021-01-07 22:51:46 +09:00
parent 2a8cc5f3ba
commit fc8ee1c3bc
7 changed files with 21 additions and 31 deletions
+1 -1
View File
@@ -230,7 +230,7 @@ pub fn delete(auth: Authorization<Write, Post>, rockets: PlumeRocket, id: i32) -
let author = User::get(&*rockets.conn, auth.0.user_id)?;
if let Ok(post) = Post::get(&*rockets.conn, id) {
if post.is_author(&*rockets.conn, author.id).unwrap_or(false) {
post.delete(&*rockets.conn, &rockets.searcher)?;
post.delete(&*rockets.conn)?;
}
}
Ok(Json(()))