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,
..
} = data;
let mut partial = PartialBot {
public,
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))
.await?;
bot.apply_options(partial);
Ok(Json(bot))
}