From f735e5ae368168c75dfa6a4254292da2e0e5eb53 Mon Sep 17 00:00:00 2001 From: Simone Taeggi Date: Mon, 24 Jul 2023 15:19:07 +0200 Subject: [PATCH] enable the draft relations count api only if we have ids selected and remove it.only from tests --- .../BulkActionButtons/ConfirmBulkActionDialog/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/core/admin/admin/src/content-manager/pages/ListView/components/BulkActionButtons/ConfirmBulkActionDialog/index.js b/packages/core/admin/admin/src/content-manager/pages/ListView/components/BulkActionButtons/ConfirmBulkActionDialog/index.js index 242b316fb0..e5c9a24033 100644 --- a/packages/core/admin/admin/src/content-manager/pages/ListView/components/BulkActionButtons/ConfirmBulkActionDialog/index.js +++ b/packages/core/admin/admin/src/content-manager/pages/ListView/components/BulkActionButtons/ConfirmBulkActionDialog/index.js @@ -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) }); },