edit mode is now perfectly working

This commit is contained in:
filipriec
2025-03-23 10:55:05 +01:00
parent 87a572783a
commit 49fe2aa793

View File

@@ -31,6 +31,7 @@ pub async fn handle_edit_event_internal(
action,
form_state,
grpc_client,
is_saved,
current_position,
total_count,
).await;
@@ -61,10 +62,20 @@ async fn execute_common_action(
action: &str,
form_state: &mut FormState,
grpc_client: &mut GrpcClient,
is_saved: &mut bool,
current_position: &mut u64,
total_count: u64,
) -> Result<String, Box<dyn std::error::Error>> {
match action {
"save" => {
common::save(
form_state,
grpc_client,
is_saved,
current_position,
total_count,
).await
},
"revert" => {
common::revert(
form_state,
@@ -72,8 +83,19 @@ async fn execute_common_action(
current_position,
total_count,
).await
}
// Add other common actions here if needed
},
"move_up" | "move_down" => {
// Reuse edit mode's existing logic
execute_edit_action(
action,
form_state,
&mut 0, // Dummy ideal_cursor_column (not used here)
grpc_client,
is_saved,
current_position,
total_count,
).await
},
_ => Ok(format!("Common action not handled: {}", action)),
}
}