Skip to content

Commit

Permalink
Fix CSV export missing last page (#7167)
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesBochet authored Sep 20, 2024
1 parent b1889e4 commit 7781d70
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 230 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,6 @@ export const useTableData = ({
});

useEffect(() => {
const MAXIMUM_REQUESTS = isDefined(totalCount)
? Math.min(maximumRequests, totalCount / pageSize)
: maximumRequests;

const fetchNextPage = async () => {
setInflight(true);
setPreviousRecordCount(records.length);
Expand All @@ -167,8 +163,8 @@ export const useTableData = ({
}

if (
pageCount >= MAXIMUM_REQUESTS ||
(isDefined(totalCount) && records.length === totalCount)
pageCount >= maximumRequests ||
(isDefined(totalCount) && records.length >= totalCount)
) {
setPageCount(0);

Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { isArray } from 'class-validator';
import { ObjectLiteral, WhereExpressionBuilder } from 'typeorm';

import { FieldMetadataInterface } from 'src/engine/metadata-modules/field-metadata/interfaces/field-metadata.interface';
Expand Down Expand Up @@ -48,6 +49,10 @@ export class GraphqlQueryFilterFieldParser {
}
const [[operator, value]] = Object.entries(filterValue);

if (operator === 'in' && (!isArray(value) || value.length === 0)) {
return;
}

const { sql, params } = this.computeWhereConditionParts(
fieldMetadata,
operator,
Expand Down

This file was deleted.

0 comments on commit 7781d70

Please sign in to comment.