mirror of
https://github.com/usebruno/bruno.git
synced 2024-11-24 17:03:47 +01:00
fix: add path params on newHttpRequest (#2843)
This commit is contained in:
parent
74b1527513
commit
4169bb7ea4
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user