diff --git a/src/formats/json.rs b/src/formats/json.rs index 0c45e06..31b5981 100644 --- a/src/formats/json.rs +++ b/src/formats/json.rs @@ -1,13 +1,17 @@ use crate::notification::Notification; -use serde_json::json; +use serde_json::{json, Value}; impl Notification { // Json format, useful for data exchange pub fn json(&self) { - let actions = json!( - {} - ); + // Actions + let actions: Value = if self.actions().is_empty() { + "None".into() + } else { + self.actions().into() + }; + json!({"actions": actions}) } } \ No newline at end of file