Added the ability to get tags from the database.
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "bard"
|
||||
version = "0.0.7"
|
||||
version = "0.0.8"
|
||||
edition = "2024"
|
||||
description = "Dioxus components that will display a Tavern blogging system Blog."
|
||||
repository = "/CyberMages/tavern"
|
||||
|
||||
@ -58,6 +58,16 @@ async fn get_database() -> Result<&'static Arc<Database>, ServerFnError>
|
||||
|
||||
|
||||
|
||||
#[server]
|
||||
pub async fn get_tags(categories: Vec<String>) -> Result<Vec<String>, ServerFnError>
|
||||
{
|
||||
let db = get_database().await?;
|
||||
|
||||
let tags = db.get_all_tags().await.map_err(|e| ServerFnError::new(e))?;
|
||||
|
||||
Ok(tags)
|
||||
}
|
||||
|
||||
#[server]
|
||||
pub async fn get_blog_list(categories: Vec<String>) -> Result<Vec<Lore>, ServerFnError>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user