]> Untitled Git - lemmy.git/blobdiff - crates/api/src/local_user/add_admin.rs
Make functions work with both connection and pool (#3420)
[lemmy.git] / crates / api / src / local_user / add_admin.rs
index a58174fb4aed02347cf086a91f39bccfd323fd57..0b478ea92c4880110f54465952ce381c4d9f7939 100644 (file)
@@ -30,7 +30,7 @@ impl Perform for AddAdmin {
     let added = data.added;
     let added_person_id = data.person_id;
     let added_admin = Person::update(
-      context.pool(),
+      &mut context.pool(),
       added_person_id,
       &PersonUpdateForm::builder().admin(Some(added)).build(),
     )
@@ -44,9 +44,9 @@ impl Perform for AddAdmin {
       removed: Some(!data.added),
     };
 
-    ModAdd::create(context.pool(), &form).await?;
+    ModAdd::create(&mut context.pool(), &form).await?;
 
-    let admins = PersonView::admins(context.pool()).await?;
+    let admins = PersonView::admins(&mut context.pool()).await?;
 
     Ok(AddAdminResponse { admins })
   }