public static bool AddNotification(NotificationAddModel notification) { if (AddNotification(Tunnel.GetTunnel(notification.tunnel), notification.condition, notification.measurement_type, notification.value, notification.repeat_after, notification.receivers, notification.isActive)) { return(true); } return(false); }
public IActionResult CreateNotification([FromBody] NotificationAddModel notification) { if (notification.condition == null || notification.measurement_type == null || notification.receivers == "" || notification.repeat_after == 0 || notification.tunnel == null || notification.value == 0) { return(BadRequest()); } else { if (Notification.AddNotification(notification)) { return(Ok()); } } return(BadRequest()); }