File tree Expand file tree Collapse file tree 1 file changed +2
-13
lines changed Expand file tree Collapse file tree 1 file changed +2
-13
lines changed Original file line number Diff line number Diff line change @@ -1482,22 +1482,11 @@ impl AlertManagerTrait for Alerts {
14821482 Ok ( alerts)
14831483 }
14841484
1485- /// Returns a sigle alert that the user has access to (based on query auth)
1485+ /// Returns a single alert that the user has access to (based on query auth)
14861486 async fn get_alert_by_id ( & self , id : Ulid ) -> Result < Box < dyn AlertTrait > , AlertError > {
14871487 let read_access = self . alerts . read ( ) . await ;
14881488 if let Some ( alert) = read_access. get ( & id) {
1489- let alert: Box < dyn AlertTrait > = match & alert. get_alert_type ( ) {
1490- AlertType :: Threshold => {
1491- Box :: new ( ThresholdAlert :: from ( alert. to_alert_config ( ) ) ) as Box < dyn AlertTrait >
1492- }
1493- AlertType :: Anomaly => {
1494- return Err ( AlertError :: NotPresentInOSS ( "anomaly" . into ( ) ) ) ;
1495- }
1496- AlertType :: Forecast => {
1497- return Err ( AlertError :: NotPresentInOSS ( "forecast" . into ( ) ) ) ;
1498- }
1499- } ;
1500- Ok ( alert)
1489+ Ok ( alert. clone_box ( ) )
15011490 } else {
15021491 Err ( AlertError :: CustomError ( format ! (
15031492 "No alert found for the given ID- {id}"
You can’t perform that action at this time.
0 commit comments