Merge pull request #17428 from strapi/fix/not-call-number-draft-relations-api-with-no-ids

Bulk publish: fix, enable countManyEntriesDraftRelations API only when you have selected entries in the modal
This commit is contained in:
Simone 2023-07-24 15:42:52 +02:00 committed by GitHub
commit d2a2d80f33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -104,6 +104,8 @@ const ConfirmDialogPublishAll = ({ isOpen, onToggleDialog, isConfirmButtonLoadin
return data;
},
{
// The API is called everytime you select/deselect an entry, this check avoids us sending a query with bad data
enabled: selectedEntries.length > 0,
onError(error) {
toggleNotification({ type: 'warning', message: formatAPIError(error) });
},