use crate::{entities::*, errors::UserError, services::user_session::UserSession}; use flowy_dispatch::prelude::*; use std::{convert::TryInto, sync::Arc}; pub async fn user_get_status_handler( session: ModuleData>, ) -> ResponseResult { let user_detail = session.current_user_detail()?; response_ok(user_detail) } pub async fn sign_out_handler(session: ModuleData>) -> Result<(), UserError> { let _ = session.sign_out().await?; Ok(()) } pub async fn update_user_handler( data: Data, session: ModuleData>, ) -> ResponseResult { let params: UpdateUserParams = data.into_inner().try_into()?; let user_detail = session.update_user(params).await?; response_ok(user_detail) }