summaryrefslogtreecommitdiff
path: root/src/channel/routes.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/channel/routes.rs')
-rw-r--r--src/channel/routes.rs5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/channel/routes.rs b/src/channel/routes.rs
index 6e06cc9..864f1b3 100644
--- a/src/channel/routes.rs
+++ b/src/channel/routes.rs
@@ -5,7 +5,6 @@ use axum::{
Router,
};
-use super::repo::Provider as _;
use crate::{app::App, error::InternalError, login::repo::logins::Login};
pub fn router() -> Router<App> {
@@ -22,9 +21,7 @@ async fn on_create(
_: Login, // requires auth, but doesn't actually care who you are
Form(form): Form<CreateRequest>,
) -> Result<impl IntoResponse, InternalError> {
- let mut tx = app.db.begin().await?;
- tx.channels().create(&form.name).await?;
- tx.commit().await?;
+ app.channels().create(&form.name).await?;
Ok(Redirect::to("/"))
}