Skip to content

Commit

Permalink
fix option to some
Browse files Browse the repository at this point in the history
  • Loading branch information
isaidsari committed Mar 14, 2024
1 parent 30dec19 commit 8d979fa
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/grpc/grpc_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ impl NotificationServiceImpl for NotificationService {

if configs.is_empty() {
return Ok(Response::new(NotificationResponse {
message: "No monitor configs found".to_string(),
success: false,
message: Some("No monitor configs found".to_string()),
}));
};

Expand All @@ -68,12 +69,12 @@ impl NotificationServiceImpl for NotificationService {
let response = if res.is_ok() {
NotificationResponse {
success: true,
message: Option::from("Notification sent successfully".to_string()),
message: Some(String::from("Notification sent")),
}
} else {
NotificationResponse {
success: false,
message: Option::from("Failed to send notification".to_string()),
message: Some(format!("Failed to send notification: {}", res.err().unwrap())),
}
};

Expand Down

0 comments on commit 8d979fa

Please sign in to comment.