Added the ability to get tags from the database.
This commit is contained in:
@ -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