(
self: &Arc<Self>,
notification: &mut Notification,
)
| 519 | } |
| 520 | |
| 521 | pub async fn edit_notification( |
| 522 | self: &Arc<Self>, |
| 523 | notification: &mut Notification, |
| 524 | ) -> Result<()> { |
| 525 | let json = serde_json::to_value(notification.clone()).unwrap(); |
| 526 | let config_json = |
| 527 | serde_json::to_value(notification.config.clone().unwrap_or_else(|| json!({}))).unwrap(); |
| 528 | |
| 529 | let merge = serde_merge::omerge(config_json, &json).unwrap(); |
| 530 | |
| 531 | notification.id = Some( |
| 532 | self.call( |
| 533 | "addNotification", |
| 534 | vec![merge, notification.id.into()], |
| 535 | "/id", |
| 536 | true, |
| 537 | ) |
| 538 | .await?, |
| 539 | ); |
| 540 | |
| 541 | Ok(()) |
| 542 | } |
| 543 | |
| 544 | pub async fn delete_notification(self: &Arc<Self>, notification_id: i32) -> Result<()> { |
| 545 | let _: bool = self |
no test coverage detected