Add default limit when fetching records (#14532)
- set default limit on front find many hooks - use default constant in rest api find many endpoint - set a max limit in rest api find many endpoint
This commit is contained in:
+5
-2
@@ -3,7 +3,10 @@ import { renderHook, waitFor } from '@testing-library/react';
|
||||
import { viewableRecordIdComponentState } from '@/command-menu/pages/record-page/states/viewableRecordIdComponentState';
|
||||
import { CommandMenuPageComponentInstanceContext } from '@/command-menu/states/contexts/CommandMenuPageComponentInstanceContext';
|
||||
import gql from 'graphql-tag';
|
||||
import { QUERY_MAX_RECORDS } from 'twenty-shared/constants';
|
||||
import {
|
||||
QUERY_DEFAULT_LIMIT_RECORDS,
|
||||
QUERY_MAX_RECORDS,
|
||||
} from 'twenty-shared/constants';
|
||||
import { generateEmptyJestRecordNode } from '~/testing/jest/generateEmptyJestRecordNode';
|
||||
import { getJestMetadataAndApolloMocksWrapper } from '~/testing/jest/getJestMetadataAndApolloMocksWrapper';
|
||||
import { useEmailThreadInCommandMenu } from '../useEmailThreadInCommandMenu';
|
||||
@@ -309,7 +312,7 @@ const mocks = [
|
||||
filter: { messageId: { in: ['1', '2'] }, role: { eq: 'from' } },
|
||||
orderBy: undefined,
|
||||
lastCursor: undefined,
|
||||
limit: undefined,
|
||||
limit: QUERY_DEFAULT_LIMIT_RECORDS,
|
||||
},
|
||||
},
|
||||
result: jest.fn(() => ({
|
||||
|
||||
Reference in New Issue
Block a user