mirror of
https://github.com/modrinth/code.git
synced 2026-08-31 03:55:59 +00:00
feat: blocking api interfaces
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user