Skip to content

Commit 937e7bb

Browse files
authored
fix: pass batch size to getMany requests [FUS-561] (#1062)
The CDA has a limit of 100 items for the getMany content types call regardless of the number of passed ids for filtering. It creates issues when request batch size is bigger (e.g. 300). This PR passes the batch size as a filter value.
1 parent 4b3f83c commit 937e7bb

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/engine/create-changeset/tasks/create-fetch-changed-task.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import { ListrTask } from 'listr2'
22
import { chunk } from 'lodash'
3-
import { BaseContext, UpdatedChangesetItem, EntityType, EntryWithOptionalMetadata } from '../../types'
3+
import { UpdatedChangesetItem, EntityType, EntryWithOptionalMetadata } from '../../types'
44
import { createLinkObject } from '../../utils/create-link-object'
55
import type { CreateChangesetContext } from '../types'
66
import { createPatch } from '../../utils/create-patch'
77
import { pluralizeEntry } from '../../utils/pluralize'
88
import { ContentType, Entry } from 'contentful'
99

1010
type GetEntityPatchParams = {
11-
context: BaseContext
11+
context: CreateChangesetContext
1212
source: string
1313
target: string
1414
entityIds: string[]
@@ -29,8 +29,9 @@ async function getEntityPatches({
2929
}: GetEntityPatchParams): Promise<UpdatedChangesetItem[]> {
3030
const {
3131
client: { cda },
32+
requestBatchSize,
3233
} = context
33-
const query = { 'sys.id[in]': entityIds.join(','), locale: '*' }
34+
const query = { 'sys.id[in]': entityIds.join(','), locale: '*', limit: requestBatchSize }
3435

3536
const api = cda[entityType]
3637

0 commit comments

Comments
 (0)