Skip to content

Commit

Permalink
Add constant to server side
Browse files Browse the repository at this point in the history
  • Loading branch information
Tostti committed Dec 6, 2024
1 parent dd336ae commit 0445538
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions plugins/main/server/controllers/wazuh-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ import { Parser } from 'json2csv';
import { KeyEquivalence } from '../../common/csv-key-equivalence';
import { ApiErrorEquivalence } from '../lib/api-errors-equivalence';
import apiRequestList from '../../common/api-info/endpoints';
import { HTTP_STATUS_CODES } from '../../common/constants';
import {
HTTP_STATUS_CODES,
TABLE_EXPORT_MAX_ROWS,
} from '../../common/constants';
import { addJobToQueue } from '../start/queue';
import jwtDecode from 'jwt-decode';
import {
Expand Down Expand Up @@ -784,8 +787,8 @@ export class WazuhApiCtrl {
params.offset = 0;
itemsArray.push(...output.data.data.affected_items);
while (
itemsArray.length < Math.min(totalItems, 10000) &&
params.offset < Math.min(totalItems, 10000)
itemsArray.length < Math.min(totalItems, TABLE_EXPORT_MAX_ROWS) &&
params.offset < Math.min(totalItems, TABLE_EXPORT_MAX_ROWS)
) {
params.offset += params.limit;
const tmpData = await context.wazuh.api.client.asCurrentUser.request(
Expand Down

0 comments on commit 0445538

Please sign in to comment.