settings: add base url, WIP flash system
This commit is contained in:
parent
f2bea92272
commit
c670201b86
18 changed files with 190 additions and 68 deletions
|
|
@ -10,6 +10,7 @@ pub struct Settings {
|
|||
pub updated_at: DateTime<Utc>,
|
||||
pub business_name: Option<String>,
|
||||
pub business_logo: Option<Vec<u8>>,
|
||||
pub url: Option<String>,
|
||||
}
|
||||
|
||||
impl Settings {
|
||||
|
|
@ -67,4 +68,13 @@ impl Settings {
|
|||
|
||||
Ok((query.rows_affected() == 1).then_some(()))
|
||||
}
|
||||
|
||||
pub async fn set_url(conn: impl SqliteExecutor<'_>, url: &str) -> Result<Option<()>, Error> {
|
||||
let query: SqliteQueryResult = sqlx::query_file!("queries/settings/set_url.sql", url)
|
||||
.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