Needed to add error printing for testing.
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "bard"
|
||||
version = "0.0.5"
|
||||
version = "0.0.6"
|
||||
edition = "2024"
|
||||
description = "Dioxus components that will display a Tavern blogging system Blog."
|
||||
repository = "/CyberMages/tavern"
|
||||
|
||||
@ -283,9 +283,13 @@ pub fn PostHeader(title: String, author: String, tags: Vec<String>) -> Element
|
||||
pub fn BlogPost(slug: String, children: Element) -> Element
|
||||
{
|
||||
// 1. Fetch the blog post using the slug.
|
||||
let Ok(post) = use_server_future(move || get_blog_post(slug.clone())) else
|
||||
let post = match use_server_future(move || get_blog_post(slug.clone()))
|
||||
{
|
||||
return rsx! { p { "Failed to load post." } }
|
||||
Ok(post) => { post }
|
||||
Err(e) =>
|
||||
{
|
||||
return rsx! { p { "Failed to load post." } p { "{e}" } }
|
||||
}
|
||||
};
|
||||
|
||||
// Then build the component.
|
||||
|
||||
Reference in New Issue
Block a user