commit
This commit is contained in:
parent
f507d0b687
commit
7506134553
@ -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})
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user