feat: leave workspace api (#4942)

* feat: leave workpspace event

* feat: add leave workspace event

---------

Co-authored-by: Lucas.Xu <lucas.xu@appflowy.io>
This commit is contained in:
Zack
2024-03-29 17:53:59 +09:00
committed by GitHub
parent 490cb48354
commit 3f4a409364
10 changed files with 108 additions and 20 deletions

View File

@ -346,6 +346,16 @@ where
Ok(())
})
}
fn leave_workspace(&self, workspace_id: &str) -> FutureResult<(), FlowyError> {
let try_get_client = self.server.try_get_client();
let workspace_id = workspace_id.to_string();
FutureResult::new(async move {
let client = try_get_client?;
client.leave_workspace(&workspace_id).await?;
Ok(())
})
}
}
async fn get_admin_client(client: &Arc<AFCloudClient>) -> FlowyResult<Client> {