settings: get first admin
This commit is contained in:
parent
0baeeadce9
commit
4bfc8a517f
4 changed files with 8 additions and 1 deletions
|
|
@ -3,7 +3,8 @@ select id,
|
||||||
updated_at as "updated_at: DateTime<Utc>",
|
updated_at as "updated_at: DateTime<Utc>",
|
||||||
business_name,
|
business_name,
|
||||||
business_logo,
|
business_logo,
|
||||||
url
|
url,
|
||||||
|
first_admin
|
||||||
|
|
||||||
from settings
|
from settings
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ pub struct Settings {
|
||||||
pub business_name: Option<String>,
|
pub business_name: Option<String>,
|
||||||
pub business_logo: Option<Vec<u8>>,
|
pub business_logo: Option<Vec<u8>>,
|
||||||
pub url: Option<String>,
|
pub url: Option<String>,
|
||||||
|
pub first_admin: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Settings {
|
impl Settings {
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ impl From<DatabaseSettings> for Settings {
|
||||||
.business_logo
|
.business_logo
|
||||||
.unwrap_or_else(|| DEFAULT_BUSINESS_LOGO.to_vec()),
|
.unwrap_or_else(|| DEFAULT_BUSINESS_LOGO.to_vec()),
|
||||||
url: db.url,
|
url: db.url,
|
||||||
|
first_admin: db.first_admin,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ pub struct Settings {
|
||||||
business_name: String,
|
business_name: String,
|
||||||
business_logo: Vec<u8>,
|
business_logo: Vec<u8>,
|
||||||
url: Option<String>,
|
url: Option<String>,
|
||||||
|
first_admin: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Settings {
|
impl Settings {
|
||||||
|
|
@ -32,4 +33,7 @@ impl Settings {
|
||||||
pub fn updated_at(&self) -> DateTime<Utc> {
|
pub fn updated_at(&self) -> DateTime<Utc> {
|
||||||
self.updated_at
|
self.updated_at
|
||||||
}
|
}
|
||||||
|
pub fn first_admin(&self) -> Option<&str> {
|
||||||
|
self.first_admin.as_deref()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue