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