Skip to content

Commit

Permalink
Removes actions from the export again.
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankHassanabad committed Aug 26, 2021
1 parent aa00c73 commit e4a3d9b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ export const getExportAll = async (
}> => {
const ruleAlertTypes = await getNonPackagedRules({ rulesClient });
const rules = transformAlertsToRules(ruleAlertTypes);
const rulesNdjson = transformDataToNdjson(rules);
// We do not support importing/exporting actions. When we do, delete this line of code
const rulesWithoutActions = rules.map((rule) => ({ ...rule, actions: [] }));
const rulesNdjson = transformDataToNdjson(rulesWithoutActions);
const exportDetails = getExportDetailsNdjson(rules);
return { rulesNdjson, exportDetails };
};
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ export const getExportByObjectIds = async (
exportDetails: string;
}> => {
const rulesAndErrors = await getRulesFromObjects(rulesClient, objects);
const rulesNdjson = transformDataToNdjson(rulesAndErrors.rules);
const exportDetails = getExportDetailsNdjson(rulesAndErrors.rules, rulesAndErrors.missingRules);
// We do not support importing/exporting actions. When we do, delete this line of code
const rulesWithoutActions = rulesAndErrors.rules.map((rule) => ({ ...rule, actions: [] }));
const rulesNdjson = transformDataToNdjson(rulesWithoutActions);
const exportDetails = getExportDetailsNdjson(rulesWithoutActions, rulesAndErrors.missingRules);
return { rulesNdjson, exportDetails };
};

Expand Down

0 comments on commit e4a3d9b

Please sign in to comment.