Mail sending optimization - implemented mail queue. Some minor optimizations.
This commit is contained in:
@@ -7,7 +7,7 @@ use crate::components::data_form::ForValidation;
|
||||
cfg_if! { if #[cfg(feature = "ssr")] {
|
||||
use crate::backend::get_pool;
|
||||
|
||||
pub async fn get_props(filter: Option<String>) -> Result<Vec<ResProperty>, ServerFnError> {
|
||||
pub async fn get_props(filter: Option<&'static str>) -> Result<Vec<ResProperty>, ServerFnError> {
|
||||
let pool = get_pool().await?;
|
||||
let props = if let Some(f) = filter {
|
||||
sqlx::query_as::<_, ResProperty>(&format!("SELECT * FROM property WHERE {} ORDER BY id", f)).fetch_all(&pool).await?
|
||||
@@ -38,7 +38,7 @@ pub async fn get_properties() -> Result<ApiResponse<Vec<ResProperty>>, ServerFnE
|
||||
|
||||
#[server]
|
||||
pub async fn get_active_properties() -> Result<ApiResponse<Vec<ResProperty>>, ServerFnError> {
|
||||
let props = get_props(Some("active = true".to_string())).await?;
|
||||
let props = get_props(Some("active = true")).await?;
|
||||
|
||||
Ok(ApiResponse::Data(props))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user