Limit in error records to 100
MODIFY
src/server/rest/service/AssetService.ts
src/server/rest/service/AssetService.ts
@@ -174,6 +174,10 @@ export default class AssetService {
);
// Filter
AssetSecurity.filterAssetsResponse(assets, req.user);
+ // Limit to 100
+ if (assets.result.length > 100) {
+ assets.result.length = 100;
+ }
// Return
res.json(assets);
next();

MODIFY
src/server/rest/service/ChargingStationService.ts
src/server/rest/service/ChargingStationService.ts
@@ -811,6 +811,10 @@ export default class ChargingStationService {
);
// Build the result
ChargingStationSecurity.filterChargingStationsResponse(chargingStations, req.user);
+ // Limit to 100
+ if (chargingStations.result.length > 100) {
+ chargingStations.result.length = 100;
+ }
// Return
res.json(chargingStations);
next();

MODIFY
src/server/rest/service/TransactionService.ts
src/server/rest/service/TransactionService.ts
@@ -640,6 +640,10 @@ export default class TransactionService {
});
// Filter
TransactionSecurity.filterTransactionsResponse(transactions, req.user);
+ // Limit to 100
+ if (transactions.result.length > 100) {
+ transactions.result.length = 100;
+ }
// Return
res.json(transactions);
next();

MODIFY
src/server/rest/service/UserService.ts
src/server/rest/service/UserService.ts
@@ -862,6 +862,10 @@ export default class UserService {
);
// Filter
UserSecurity.filterUsersResponse(users, req.user);
+ // Limit to 100
+ if (users.result.length > 100) {
+ users.result.length = 100;
+ }
// Return
res.json(users);
next();

MODIFY
src/server/rest/service/security/TransactionSecurity.ts
src/server/rest/service/security/TransactionSecurity.ts
-import { HttpAssignTransactionsToUserRequest, HttpConsumptionFromTransactionRequest, HttpTransactionRequest, HttpTransactionsRefundRequest, HttpTransactionsRequest, HttpUnassignTransactionsToUserRequest } from '../../../../types/requests/HttpTransactionRequest';
-import Transaction, { TransactionConsumption } from '../../../../types/Transaction';
-
+import sanitize from 'mongo-sanitize';
import Authorizations from '../../../../authorization/Authorizations';
-import Constants from '../../../../utils/Constants';
import Consumption from '../../../../types/Consumption';
import { DataResult } from '../../../../types/DataResult';
-import RefundReport from '../../../../types/Refund';
import { TransactionInError } from '../../../../types/InError';
-import UserSecurity from './UserSecurity';
+import RefundReport from '../../../../types/Refund';
+import { HttpAssignTransactionsToUserRequest, HttpConsumptionFromTransactionRequest, HttpTransactionRequest, HttpTransactionsRefundRequest, HttpTransactionsRequest, HttpUnassignTransactionsToUserRequest } from '../../../../types/requests/HttpTransactionRequest';
+import Transaction, { TransactionConsumption } from '../../../../types/Transaction';
import UserToken from '../../../../types/UserToken';
+import Constants from '../../../../utils/Constants';
import Utils from '../../../../utils/Utils';
+import UserSecurity from './UserSecurity';
import UtilsSecurity from './UtilsSecurity';
-import sanitize from 'mongo-sanitize';
+
export default class TransactionSecurity {
public static filterTransactionsRefund(request: any): HttpTransactionsRefundRequest {

Limit in error records to 100