feat: blocking api interfaces

This commit is contained in:
Calum H. (IMB11)
2026-07-28 15:47:21 +01:00
parent 82348fe40a
commit 90bfe88dac
8 changed files with 181 additions and 0 deletions
+18
View File
@@ -32,6 +32,21 @@ pub async fn patch_user(user_id: &str, patch: Value) -> Result<()> {
Ok(theseus::users::patch_user(user_id, patch).await?)
}
#[tauri::command]
pub async fn block_user(user_id: &str) -> Result<()> {
Ok(theseus::users::block_user(user_id).await?)
}
#[tauri::command]
pub async fn unblock_user(user_id: &str) -> Result<()> {
Ok(theseus::users::unblock_user(user_id).await?)
}
#[tauri::command]
pub async fn get_blocked_users() -> Result<Vec<String>> {
Ok(theseus::users::get_blocked_users().await?)
}
pub fn init<R: tauri::Runtime>() -> tauri::plugin::TauriPlugin<R> {
tauri::plugin::Builder::new("users")
.invoke_handler(tauri::generate_handler![
@@ -41,6 +56,9 @@ pub fn init<R: tauri::Runtime>() -> tauri::plugin::TauriPlugin<R> {
get_user_organizations,
get_user_collections,
patch_user,
block_user,
unblock_user,
get_blocked_users,
])
.build()
}