Send the current request
(&mut self, cx: &mut Context<Self>)
| 1493 | collections.toggle_collection_expanded(collection_id, cx); |
| 1494 | }); |
| 1495 | } |
| 1496 | |
| 1497 | pub fn toggle_collection_node_expand( |
| 1498 | &mut self, |
| 1499 | collection_id: Uuid, |
| 1500 | node_id: Uuid, |
| 1501 | cx: &mut Context<Self>, |
| 1502 | ) { |
| 1503 | self.collections.update(cx, |collections, cx| { |
| 1504 | collections.toggle_node_expanded(collection_id, node_id, cx); |
| 1505 | }); |
| 1506 | } |
| 1507 | |
| 1508 | pub fn create_collection_folder( |
| 1509 | &mut self, |
| 1510 | collection_id: Uuid, |
| 1511 | parent_folder_id: Option<Uuid>, |
| 1512 | name: &str, |
| 1513 | cx: &mut Context<Self>, |
| 1514 | ) { |
| 1515 | self.collections.update(cx, |collections, cx| { |
| 1516 | collections.create_folder(collection_id, parent_folder_id, name, cx); |
| 1517 | }); |
| 1518 | } |
| 1519 | |
| 1520 | #[allow(dead_code)] |
| 1521 | pub fn save_request_to_destination( |
| 1522 | &mut self, |
| 1523 | destination: CollectionDestination, |
| 1524 | request_name: String, |
| 1525 | request_data: RequestData, |
| 1526 | cx: &mut Context<Self>, |
| 1527 | ) { |
| 1528 | let mut request_data = request_data; |
| 1529 | request_data.name = request_name; |
| 1530 | self.save_saved_request_to_destination( |
| 1531 | destination, |
| 1532 | SavedRequestData::Http(request_data), |
| 1533 | cx, |
| 1534 | ); |
| 1535 | } |
| 1536 | |
| 1537 | pub fn save_saved_request_to_destination( |
| 1538 | &mut self, |
| 1539 | destination: CollectionDestination, |
| 1540 | request: SavedRequestData, |
| 1541 | cx: &mut Context<Self>, |
| 1542 | ) { |
| 1543 | self.collections.update(cx, |collections, cx| { |
| 1544 | collections.add_saved_request_node( |
| 1545 | destination.collection_id, |
| 1546 | destination.folder_id, |
| 1547 | request, |
| 1548 | cx, |
| 1549 | ); |
| 1550 | }); |
| 1551 | if let Some(tab) = self.tabs.get_mut(self.active_tab_index) { |
| 1552 | tab.collection_id = Some(destination.collection_id); |
no test coverage detected