aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorYour Name <you@example.com>2020-05-02 16:01:19 +0200
committerYour Name <you@example.com>2020-05-02 16:01:19 +0200
commiteb917c35008d32b3b27bf132b5f831f05888be54 (patch)
tree9e4373290471bc535a1bcdc23322cf290a30f456 /examples
parente95d9f86d2d9f2e689393f1e486b6250b2b075db (diff)
downloadrust-zotapi-eb917c35008d32b3b27bf132b5f831f05888be54.tar.gz
rust-zotapi-eb917c35008d32b3b27bf132b5f831f05888be54.tar.bz2
rust-zotapi-eb917c35008d32b3b27bf132b5f831f05888be54.zip
zotcli: Don't dump raw json response after post item.
Diffstat (limited to 'examples')
-rw-r--r--examples/zot/item.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/examples/zot/item.rs b/examples/zot/item.rs
index 9869492..648a9f0 100644
--- a/examples/zot/item.rs
+++ b/examples/zot/item.rs
@@ -43,8 +43,12 @@ pub fn post(client: &zotapi::Client, args: &ArgMatches) {
}
match msg.create(&client) {
- Ok(payload) => {
- println!("Raw payload: {}", payload);
+ Ok(res) => {
+ if res.success {
+ println!("New item with id {} posted successfully!", res.item_id);
+ } else {
+ println!("The item could not be posted.");
+ }
}
Err(e) => {
println!("Error posting message: {:?}", e);