feat: add archive sub command
Some checks failed
continuous-integration/drone/push Build is failing

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
2024-06-01 13:13:18 +02:00
parent 710fb431f7
commit 9587c60e72
17 changed files with 232 additions and 43 deletions

View File

@@ -27,7 +27,6 @@ impl Commander {
let request = tonic::Request::new(CreateRootRequest { root });
let response = client.create_root(request).await?;
let res = response.into_inner();
//self.engine.create_root(&root)?;
}
Command::CreateSection { root, path } => {
let channel = self.channel.clone();
@@ -37,12 +36,6 @@ impl Commander {
let request = tonic::Request::new(CreateSectionRequest { root, path });
let response = client.create_section(request).await?;
let res = response.into_inner();
// self.engine.create(
// &root,
// &path.iter().map(|p| p.as_str()).collect::<Vec<_>>(),
// GraphItem::Section(BTreeMap::default()),
// )?;
}
Command::CreateItem {
root,
@@ -73,23 +66,9 @@ impl Commander {
});
let response = client.create_item(request).await?;
let res = response.into_inner();
// self.engine.create(
// &root,
// &path.iter().map(|p| p.as_str()).collect::<Vec<_>>(),
// GraphItem::Item {
// title,
// description,
// state,
// },
// )?
}
Command::Move { root, src, dest } => {
todo!()
// self.engine.section_move(
// &root,
// &src.iter().map(|p| p.as_str()).collect::<Vec<_>>(),
// &dest.iter().map(|p| p.as_str()).collect::<Vec<_>>(),
// )?
}
Command::ToggleItem { root, path } => {
let channel = self.channel.clone();
@@ -129,21 +108,18 @@ impl Commander {
});
let response = client.update_item(request).await?;
let res = response.into_inner();
// self.engine.update_item(
// &root,
// &path.iter().map(|p| p.as_str()).collect::<Vec<_>>(),
// GraphItem::Item {
// title,
// description,
// state,
// },
// )?
}
Command::Archive { root, path } => {
let channel = self.channel.clone();
let mut client = GraphClient::new(channel);
let request = tonic::Request::new(ArchiveRequest { root, path });
let response = client.archive(request).await?;
let res = response.into_inner();
}
}
// self.storage.store(&self.engine)?;
// self.events.enque_command(cmd)?;
Ok(())
}
}