Skip to content

Commit

Permalink
Ignore clients find without params
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtemBaskal committed Jun 16, 2020
1 parent ecb322f commit a7b887b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions client/src/actions/queryLogs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
};

Expand Down

0 comments on commit a7b887b

Please sign in to comment.