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
|
|
@ -54,4 +54,17 @@ impl Settings {
|
|||
|
||||
Ok((query.rows_affected() == 1).then_some(()))
|
||||
}
|
||||
|
||||
pub async fn set_first_admin(
|
||||
conn: impl SqliteExecutor<'_>,
|
||||
id: &str,
|
||||
) -> Result<Option<()>, Error> {
|
||||
let query: SqliteQueryResult =
|
||||
sqlx::query_file!("queries/settings/set_first_admin.sql", id)
|
||||
.execute(conn)
|
||||
.await
|
||||
.map_err(handle_error)?;
|
||||
|
||||
Ok((query.rows_affected() == 1).then_some(()))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue