fix: apply partial to bot object

This commit is contained in:
Paul Makles
2022-02-11 12:49:34 +00:00
parent 5aee381fd6
commit f0eb228b19

View File

@@ -63,6 +63,7 @@ pub async fn edit_bot(db: &Db, user: User, target: Ref, data: Json<Data>) -> Res
remove, remove,
.. ..
} = data; } = data;
let mut partial = PartialBot { let mut partial = PartialBot {
public, public,
analytics, analytics,
@@ -82,5 +83,7 @@ pub async fn edit_bot(db: &Db, user: User, target: Ref, data: Json<Data>) -> Res
db.update_bot(&bot.id, &partial, remove.unwrap_or_else(Vec::new)) db.update_bot(&bot.id, &partial, remove.unwrap_or_else(Vec::new))
.await?; .await?;
bot.apply_options(partial);
Ok(Json(bot)) Ok(Json(bot))
} }