fix: add path params on newHttpRequest (#2843)

This commit is contained in:
Chae Jeong Ah 2024-08-16 19:16:38 +09:00 committed by GitHub
parent 74b1527513
commit 4169bb7ea4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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';
@ -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,