You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mediarepo/mediarepo-api/src/tauri_plugin/commands/tag.rs

23 lines
590 B
Rust

use crate::tauri_plugin::commands::ApiAccess;
use crate::tauri_plugin::error::PluginResult;
use crate::types::tags::TagResponse;
#[tauri::command]
pub async fn get_all_tags(api_state: ApiAccess<'_>) -> PluginResult<Vec<TagResponse>> {
let api = api_state.api().await?;
let all_tags = api.tag.get_all_tags().await?;
Ok(all_tags)
}
#[tauri::command]
pub async fn get_tags_for_file(
hash: String,
api_state: ApiAccess<'_>,
) -> PluginResult<Vec<TagResponse>> {
let api = api_state.api().await?;
let tags = api.tag.get_tags_for_file(hash).await?;
Ok(tags)
}