MCPcopy Create free account
hub / github.com/bajrangCoder/setu / add_request_node

Method add_request_node

src/entities/collections.rs:541–563  ·  view source on GitHub ↗
(
        &mut self,
        collection_id: Uuid,
        parent_folder_id: Option<Uuid>,
        request: RequestData,
        cx: &mut Context<Self>,
    )

Source from the content-addressed store, hash-verified

539 .nodes
540 .into_iter()
541 .map(CollectionNode::from_imported_node)
542 .collect(),
543 expanded: true,
544 };
545 let id = collection.id;
546 self.collections.push(collection);
547 self.bump_revision();
548 self.save_to_file();
549 cx.emit(CollectionsEvent::CollectionAdded(id));
550 cx.notify();
551 id
552 }
553
554 pub fn remove_collection(&mut self, id: Uuid, cx: &mut Context<Self>) {
555 if let Some(pos) = self.collections.iter().position(|c| c.id == id) {
556 self.collections.remove(pos);
557 self.bump_revision();
558 self.save_to_file();
559 cx.emit(CollectionsEvent::CollectionRemoved(id));
560 cx.notify();
561 }
562 }
563
564 pub fn rename_collection(&mut self, id: Uuid, new_name: &str, cx: &mut Context<Self>) {
565 if let Some(collection) = self.collections.iter_mut().find(|c| c.id == id) {
566 collection.name = new_name.to_string();

Callers 1

Calls 3

insert_nodeFunction · 0.85
idMethod · 0.80
save_to_fileMethod · 0.45

Tested by

no test coverage detected