Skip to content

Commit

Permalink
Remove unnecessary values
Browse files Browse the repository at this point in the history
  • Loading branch information
Tostti committed Dec 13, 2024
1 parent 813f208 commit 5df89d1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions plugins/main/public/components/common/tables/table-wz-api.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ export function TableWzAPI({
);
const [isOpenFieldSelector, setIsOpenFieldSelector] = useState(false);
const appConfig = useAppConfig();

const maxRows = appConfig.data['reports.csv.maxRows'] || 10000;
console.log(rest.tableColumns);
const maxRows = appConfig.data['reports.csv.maxRows'];
const onSearch = useCallback(async function (
endpoint,
filters: Filters,
Expand Down
3 changes: 2 additions & 1 deletion plugins/main/server/controllers/wazuh-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ export class WazuhApiCtrl {
response: OpenSearchDashboardsResponseFactory,
) {
const appConfig = await context.wazuh_core.configuration.get();
const reportMaxRows = appConfig['reports.csv.maxRows'] || 10000;
const reportMaxRows = appConfig['reports.csv.maxRows'];
try {
if (!request.body || !request.body.path)
throw new Error('Field path is required');
Expand Down Expand Up @@ -797,6 +797,7 @@ export class WazuhApiCtrl {

const affectedItems = tmpData.data.data.affected_items;
const remainingItems = reportMaxRows - itemsArray.length;
console.log(affectedItems[0]);
if (itemsArray.length + affectedItems.length > reportMaxRows) {
itemsArray.push(...affectedItems.slice(0, remainingItems));
break;
Expand Down

0 comments on commit 5df89d1

Please sign in to comment.