settings: store id of first admin user
This commit is contained in:
parent
3e168c19bc
commit
a3866b0af2
5 changed files with 25 additions and 0 deletions
|
|
@ -5,5 +5,6 @@ edition = "2021"
|
|||
|
||||
[dependencies]
|
||||
database = { path = "../database" }
|
||||
id = { path = "../id" }
|
||||
thiserror = { workspace = true }
|
||||
chrono = { workspace = true }
|
||||
|
|
@ -2,6 +2,7 @@ use crate::error::Error;
|
|||
use crate::Settings;
|
||||
use database::sqlx::SqliteExecutor;
|
||||
use database::Settings as DatabaseSettings;
|
||||
use id::UserID;
|
||||
|
||||
const DEFAULT_BUSINESS_NAME: &str = "ezidam";
|
||||
pub const DEFAULT_BUSINESS_LOGO: &[u8] = include_bytes!("../../../logo/ezidam.png");
|
||||
|
|
@ -48,4 +49,10 @@ impl Settings {
|
|||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub async fn set_first_admin(conn: impl SqliteExecutor<'_>, id: &UserID) -> Result<(), Error> {
|
||||
DatabaseSettings::set_first_admin(conn, &id.0).await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue