From 78b96d55df2446c0440631dae4acb0ff54bdfcb1 Mon Sep 17 00:00:00 2001 From: Denux Date: Thu, 9 Jan 2025 08:46:16 +0100 Subject: [PATCH] updated loco --- backend/src/app.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/src/app.rs b/backend/src/app.rs index 25b7fc52..4b01fe29 100644 --- a/backend/src/app.rs +++ b/backend/src/app.rs @@ -26,7 +26,6 @@ use loco_rs::{ }; use migration::Migrator; use mimalloc::MiMalloc; -use sea_orm::DatabaseConnection; use std::path::Path; #[global_allocator] @@ -112,7 +111,8 @@ impl Hooks for App { // tasks-inject (do not remove) } - async fn truncate(db: &DatabaseConnection) -> Result<()> { + async fn truncate(ctx: &AppContext) -> Result<()> { + let db = &ctx.db; // TODO add all other tables truncate_table(db, users::Entity).await?; truncate_table(db, instances::Entity).await?; @@ -120,7 +120,7 @@ impl Hooks for App { Ok(()) } - async fn seed(_db: &DatabaseConnection, _path: &Path) -> Result<()> { + async fn seed(_ctx: &AppContext, _path: &Path) -> Result<()> { Ok(()) } }