Skip to content

Commit

Permalink
fix: add path params on newHttpRequest (#2843)
Browse files Browse the repository at this point in the history
  • Loading branch information
jokj624 authored Aug 16, 2024
1 parent 74b1527 commit 4169bb7
Showing 1 changed file with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import {
import { each } from 'lodash';
import { closeAllCollectionTabs } from 'providers/ReduxStore/slices/tabs';
import { resolveRequestFilename } from 'utils/common/platform';
import { parseQueryParams, splitOnFirst } from 'utils/url/index';
import { parsePathParams, parseQueryParams, splitOnFirst } from 'utils/url/index';
import { sendCollectionOauth2Request as _sendCollectionOauth2Request } from 'utils/network/index';
import { name } from 'file-loader';

Expand Down Expand Up @@ -708,11 +708,20 @@ export const newHttpRequest = (params) => (dispatch, getState) => {
}

const parts = splitOnFirst(requestUrl, '?');
const params = parseQueryParams(parts[1]);
each(params, (urlParam) => {
const queryParams = parseQueryParams(parts[1]);
each(queryParams, (urlParam) => {
urlParam.enabled = true;
urlParam.type = 'query';
});

const pathParams = parsePathParams(requestUrl);
each(pathParams, (pathParm) => {
pathParams.enabled = true;
pathParm.type = 'path'
});

const params = [...queryParams, ...pathParams];

const item = {
uid: uuid(),
type: requestType,
Expand Down

0 comments on commit 4169bb7

Please sign in to comment.