From e6bcd31b6adcbcf4f78b594e09448d665e65bfb2 Mon Sep 17 00:00:00 2001 From: Frank Wang <1454884738@qq.com> Date: Tue, 17 Sep 2024 16:39:14 -0500 Subject: [PATCH] fix: delete table row --- src/tui/tui_logic/request/body.rs | 4 ++-- src/tui/tui_logic/request/headers.rs | 4 ++-- src/tui/tui_logic/request/query_params.rs | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/tui/tui_logic/request/body.rs b/src/tui/tui_logic/request/body.rs index 242028b..218b010 100644 --- a/src/tui/tui_logic/request/body.rs +++ b/src/tui/tui_logic/request/body.rs @@ -59,10 +59,10 @@ impl App<'_> { return; } - let selection = self.body_form_table.selection.unwrap(); + let selected_row = self.body_form_table.selection.unwrap(); let selected_request_index = &self.collections_tree.selected.unwrap(); - if let Err(_) = self.delete_form_data(selection.0, selected_request_index.0, selected_request_index.1) { + if let Err(_) = self.delete_form_data(selected_request_index.0, selected_request_index.1, selected_row.0) { return; } diff --git a/src/tui/tui_logic/request/headers.rs b/src/tui/tui_logic/request/headers.rs index 675a0f8..ee5ccf1 100644 --- a/src/tui/tui_logic/request/headers.rs +++ b/src/tui/tui_logic/request/headers.rs @@ -51,10 +51,10 @@ impl App<'_> { return; } - let selection = self.headers_table.selection.unwrap(); + let selected_row = self.headers_table.selection.unwrap(); let selected_request_index = &self.collections_tree.selected.unwrap(); - match self.delete_header(selection.0, selected_request_index.0, selected_request_index.1) { + match self.delete_header(selected_request_index.0, selected_request_index.1, selected_row.0) { Ok(_) => {} Err(_) => return } diff --git a/src/tui/tui_logic/request/query_params.rs b/src/tui/tui_logic/request/query_params.rs index f89a978..7d1c808 100644 --- a/src/tui/tui_logic/request/query_params.rs +++ b/src/tui/tui_logic/request/query_params.rs @@ -52,10 +52,10 @@ impl App<'_> { return; } - let selection = self.query_params_table.selection.unwrap(); + let selected_row = self.query_params_table.selection.unwrap(); let selected_request_index = &self.collections_tree.selected.unwrap(); - match self.delete_query_param(selection.0, selected_request_index.0, selected_request_index.1) { + match self.delete_query_param(selected_request_index.0, selected_request_index.1, selected_row.0) { Ok(_) => {} Err(_) => return }