diff --git a/client/src/actions/queryLogs.js b/client/src/actions/queryLogs.js index c1b41aff7bc..2a230622996 100644 --- a/client/src/actions/queryLogs.js +++ b/client/src/actions/queryLogs.js @@ -9,13 +9,16 @@ const getLogsWithParams = async (config) => { const { older_than, filter, ...values } = config; const rawLogs = await apiClient.getQueryLog({ ...filter, older_than }); const { data, oldest } = rawLogs; - const logs = normalizeLogs(data); + let logs = normalizeLogs(data); const clientsParams = getParamsForClientsSearch(logs, 'client'); - const clients = await apiClient.findClients(clientsParams); - const logsWithClientInfo = addClientInfo(logs, clients, 'client'); + + if (Object.keys(clientsParams).length > 0) { + const clients = await apiClient.findClients(clientsParams); + logs = addClientInfo(logs, clients, 'client'); + } return { - logs: logsWithClientInfo, oldest, older_than, filter, ...values, + logs, oldest, older_than, filter, ...values, }; };