eur czk can be disabled from now on
This commit is contained in:
@@ -10,7 +10,7 @@ use loco_rs::prelude::*;
|
||||
use sea_orm::{ActiveModelTrait, ColumnTrait, EntityTrait, PaginatorTrait, QueryFilter, Set};
|
||||
|
||||
use crate::models::currencies;
|
||||
use crate::shared::currency::SCALE;
|
||||
use crate::shared::currency::{self, SCALE};
|
||||
|
||||
/// `(code, symbol, default_rate_e4)` — default rate is a placeholder the admin
|
||||
/// is expected to update from the live FX rate.
|
||||
@@ -45,6 +45,8 @@ impl Initializer for CurrencySeeder {
|
||||
.await?;
|
||||
tracing::info!(currency = code, "seeded display currency");
|
||||
}
|
||||
// Prime the process-wide snapshot used by the navbar/settings chrome.
|
||||
currency::refresh_snapshot(&ctx.db).await?;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,6 +54,12 @@ impl Initializer for ViewEngineInitializer {
|
||||
crate::shared::csrf::current_token().unwrap_or_default(),
|
||||
))
|
||||
});
|
||||
// `currencies()`: the EUR base plus enabled alternative currencies
|
||||
// (from the process-wide snapshot), used by the global chrome — the
|
||||
// settings-menu switcher and the navbar exchange-rate display.
|
||||
tera.register_function("currencies", |_args: &HashMap<String, serde_json::Value>| {
|
||||
Ok(crate::shared::currency::selectable_json())
|
||||
});
|
||||
Ok(())
|
||||
})?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user