
Some checks are pending
iOS UniFFI Build / build-ios (push) Waiting to run
Add church management API library with cross-platform support for iOS, Android, and WASM. Features include event management, bulletin handling, contact forms, and authentication.
31 lines
1 KiB
Rust
31 lines
1 KiB
Rust
use church_core::{ChurchApiClient, ChurchCoreConfig};
|
|
|
|
#[tokio::main]
|
|
async fn main() {
|
|
let config = ChurchCoreConfig::new();
|
|
|
|
match ChurchApiClient::new(config) {
|
|
Ok(client) => {
|
|
match client.get_recent_sermons(Some(5)).await {
|
|
Ok(sermons) => {
|
|
let client_sermons: Vec<church_core::ClientSermon> = sermons
|
|
.into_iter()
|
|
.map(church_core::ClientSermon::from)
|
|
.collect();
|
|
|
|
println!("🎬 Raw JSON output:");
|
|
match serde_json::to_string_pretty(&client_sermons) {
|
|
Ok(json) => println!("{}", json),
|
|
Err(e) => println!("❌ JSON serialization error: {}", e),
|
|
}
|
|
},
|
|
Err(e) => {
|
|
println!("❌ Failed to get sermons: {}", e);
|
|
}
|
|
}
|
|
}
|
|
Err(e) => {
|
|
println!("❌ Failed to create client: {}", e);
|
|
}
|
|
}
|
|
} |