switch between login or form in the save request
This commit is contained in:
@@ -131,6 +131,7 @@ impl EventHandler {
|
||||
return common::handle_core_action(
|
||||
action,
|
||||
form_state,
|
||||
&mut self.auth_state,
|
||||
grpc_client,
|
||||
terminal,
|
||||
app_state,
|
||||
@@ -191,6 +192,7 @@ impl EventHandler {
|
||||
return common::handle_core_action(
|
||||
action,
|
||||
form_state,
|
||||
&mut self.auth_state,
|
||||
grpc_client,
|
||||
terminal,
|
||||
app_state,
|
||||
|
||||
@@ -4,5 +4,5 @@ pub mod form;
|
||||
pub mod login;
|
||||
|
||||
pub use commands::*;
|
||||
pub use form::*;
|
||||
pub use login::*;
|
||||
pub use form::{revert, save as form_save};
|
||||
pub use login::{cancel, save as login_save};
|
||||
|
||||
@@ -3,19 +3,16 @@
|
||||
use crate::state::pages::auth::AuthState;
|
||||
use crate::services::grpc_client::GrpcClient;
|
||||
|
||||
/// Shared logic for login operations
|
||||
pub async fn save(
|
||||
auth_state: &mut AuthState,
|
||||
grpc_client: &mut GrpcClient,
|
||||
) -> Result<String, Box<dyn std::error::Error>> {
|
||||
// Implement your login-specific save logic here
|
||||
Ok("Login credentials saved".to_string())
|
||||
Ok("Login credentials saved - not implemented yet".to_string())
|
||||
}
|
||||
|
||||
/// Shared logic for login cancellation
|
||||
pub async fn cancel(
|
||||
auth_state: &mut AuthState,
|
||||
) -> String {
|
||||
auth_state.clear_fields();
|
||||
"Login cancelled".to_string()
|
||||
"Login credentials canceled - not implemented yet".to_string()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user