feat: can add items
All checks were successful
continuous-integration/drone/push Build is passing

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
2024-05-13 23:33:37 +02:00
parent 699bac7159
commit 7bdf8393b1
8 changed files with 300 additions and 54 deletions

View File

@@ -51,7 +51,28 @@ impl Commander {
description,
state,
} => {
todo!()
let channel = self.channel.clone();
let mut client = GraphClient::new(channel);
let request = tonic::Request::new(CreateItemRequest {
root,
path,
item: Some(ItemGraphItem {
title,
description,
item_state: Some(match state {
hyperlog_core::log::ItemState::NotDone => {
item_graph_item::ItemState::NotDone(ItemStateNotDone {})
}
hyperlog_core::log::ItemState::Done => {
item_graph_item::ItemState::Done(ItemStateDone {})
}
}),
}),
});
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<_>>(),