Skip to content

Commit

Permalink
feat: allow for changing urls
Browse files Browse the repository at this point in the history
  • Loading branch information
wllfaria committed May 23, 2024
1 parent bbd57e8 commit c9c5968
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion reqtui/src/collection/collection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ where
let collection_name = collections_dir.as_ref().join(file_name);
let file = std::fs::read_to_string(&collection_name)?;
let mut collection: Collection = serde_json::from_str(&file)?;
collection.path = collection_name.join(".json");
collection.path = collection_name;
collections.push(collection);
}

Expand Down
11 changes: 10 additions & 1 deletion tui/src/pages/collection_viewer/collection_viewer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,16 @@ impl<'ae> CollectionViewer<'ae> {
return Ok(Some(Command::Quit));
};
match key_event.code {
KeyCode::Char('i') => self.selected_pane = Some(PaneFocus::Preview),
KeyCode::Char(c) => {
if let Some(req) = self.selected_request.as_mut() {
req.borrow_mut().uri.push(c);
}
}
KeyCode::Backspace => {
if let Some(req) = self.selected_request.as_mut() {
req.borrow_mut().uri.pop();
}
}
KeyCode::Enter => {
if let Some(req) = self.selected_request.as_ref() {
reqtui::net::handle_request(
Expand Down

0 comments on commit c9c5968

Please sign in to comment.