Skip to content

Commit 4430739

Browse files
perf(ui): don't return full documents on bulk UI operations (#14145)
## What Modified bulk operation UI components (PublishMany, UnpublishMany, RestoreMany, DeleteMany, EditMany) to send an empty `select` object in their API requests, which returns only document IDs instead of full documents. ## Why Bulk operations were returning complete document data including all relationships, causing: - Large response payloads (MBs of data for 100+ documents) - Slow response times due to relationship population - High memory usage The UI only needs document counts for success/error messages, not the full data. ## How Added `select: {}` parameter to query strings in all bulk operation components. When the API receives an empty select object, it returns only the `id` field. --------- Co-authored-by: German Jablonski <43938777+GermanJablo@users.noreply.github.com>
1 parent cca97c6 commit 4430739

File tree

5 files changed

+5
-0
lines changed

5 files changed

+5
-0
lines changed

packages/ui/src/elements/DeleteMany/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ export function DeleteMany_v4({
230230
{
231231
limit: 0,
232232
locale,
233+
select: {},
233234
where: mergeListSearchAndWhere({
234235
collectionConfig,
235236
search,

packages/ui/src/elements/EditMany/DrawerContent.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ export const EditManyDrawerContent: React.FC<EditManyDrawerContentProps> = (prop
257257
return qs.stringify(
258258
{
259259
locale,
260+
select: {},
260261
where: combineWhereConstraints(whereConstraints),
261262
},
262263
{ addQueryPrefix: true },

packages/ui/src/elements/PublishMany/DrawerContent.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ export function PublishManyDrawerContent(props: PublishManyDrawerContentProps) {
9898
return qs.stringify(
9999
{
100100
locale,
101+
select: {},
101102
where: combineWhereConstraints(whereConstraints),
102103
},
103104
{ addQueryPrefix: true },

packages/ui/src/elements/RestoreMany/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ export const RestoreMany: React.FC<Props> = (props) => {
8888
{
8989
limit: 0,
9090
locale,
91+
select: {},
9192
trash: true, // Ensure trashed docs are returned
9293
where: mergeListSearchAndWhere({
9394
collectionConfig,

packages/ui/src/elements/UnpublishMany/DrawerContent.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ export function UnpublishManyDrawerContent(props: UnpublishManyDrawerContentProp
8585
return qs.stringify(
8686
{
8787
locale,
88+
select: {},
8889
where: combineWhereConstraints(whereConstraints),
8990
},
9091
{ addQueryPrefix: true },

0 commit comments

Comments
 (0)