Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { keys, pickBy } from 'lodash';
import { keys, pickBy, isEmpty } from 'lodash';

import { kea, MakeLogicType } from 'kea';

Expand Down Expand Up @@ -486,8 +486,10 @@ export const SourceLogic = kea<MakeLogicType<SourceValues, SourceActions>>({
if (subdomain) params.append('subdomain', subdomain);
if (indexPermissions) params.append('index_permissions', indexPermissions.toString());

const paramsString = !isEmpty(params) ? `?${params}` : '';

try {
const response = await HttpLogic.values.http.get(`${route}?${params}`);
const response = await HttpLogic.values.http.get(`${route}${paramsString}`);
actions.setSourceConnectData(response);
successCallback(response.oauthUrl);
} catch (e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { HttpLogic } from '../../../shared/http';

import {
flashAPIErrors,
setSuccessMessage,
setQueuedSuccessMessage,
FlashMessagesLogic,
} from '../../../shared/flash_messages';

Expand Down Expand Up @@ -225,7 +225,7 @@ export const SourcesLogic = kea<MakeLogicType<ISourcesValues, ISourcesActions>>(
}
);

setSuccessMessage(
setQueuedSuccessMessage(
[
successfullyConnectedMessage,
additionalConfiguration ? additionalConfigurationMessage : '',
Expand Down