File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
x-pack/legacy/plugins/siem/server/lib/detection_engine/rules Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 55 */
66
77import { defaults , pickBy , isEmpty } from 'lodash/fp' ;
8+ import { PartialAlert } from '../../../../../alerting/server/types' ;
89import { readRules } from './read_rules' ;
910import { UpdateRuleParams , IRuleSavedAttributesSavedObjectAttributes } from './types' ;
1011import { addTags } from './add_tags' ;
@@ -108,7 +109,7 @@ export const updateRules = async ({
108109 type,
109110 references,
110111 version,
111- } : UpdateRuleParams ) => {
112+ } : UpdateRuleParams ) : Promise < PartialAlert | null > => {
112113 const rule = await readRules ( { alertsClient, ruleId, id } ) ;
113114 if ( rule == null ) {
114115 return null ;
@@ -206,5 +207,10 @@ export const updateRules = async ({
206207 } else {
207208 // enabled is null or undefined and we do not touch the rule
208209 }
209- return update ;
210+
211+ if ( enabled != null ) {
212+ return { ...update , enabled } ;
213+ } else {
214+ return update ;
215+ }
210216} ;
You can’t perform that action at this time.
0 commit comments