[Cloud Security] Fix search in benchmark page (#161093)

This commit is contained in:
Ido Cohen 2023-07-04 13:53:39 +03:00 committed by GitHub
parent 9685de25e0
commit 122977ef09
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -27,7 +27,7 @@ export const useFindCspRuleTemplates = (
[CSP_RULE_TEMPLATE_SAVED_OBJECT_TYPE, { search, page, perPage, packagePolicyId }],
() => {
return http.get<GetCspRuleTemplateResponse>(FIND_CSP_RULE_TEMPLATE_ROUTE_PATH, {
query: { packagePolicyId, page, perPage },
query: { packagePolicyId, page, perPage, search },
version: FIND_CSP_RULE_TEMPLATE_API_CURRENT_VERSION,
});
}

View file

@ -60,9 +60,9 @@ const findCspRuleTemplateHandler = async (
filter: getBenchmarkTypeFilter(benchmarkId),
});
const cspRulesTemplates = cspRulesTemplatesSo.saved_objects.map((cspRuleTemplate) => {
return { ...cspRuleTemplate.attributes };
});
const cspRulesTemplates = cspRulesTemplatesSo.saved_objects.map(
(cspRuleTemplate) => cspRuleTemplate.attributes
);
return {
items: cspRulesTemplates,