mirror of
https://github.com/usebruno/bruno.git
synced 2025-02-17 18:20:53 +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 { each } from 'lodash';
|
||||||
import { closeAllCollectionTabs } from 'providers/ReduxStore/slices/tabs';
|
import { closeAllCollectionTabs } from 'providers/ReduxStore/slices/tabs';
|
||||||
import { resolveRequestFilename } from 'utils/common/platform';
|
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 { sendCollectionOauth2Request as _sendCollectionOauth2Request } from 'utils/network/index';
|
||||||
import { name } from 'file-loader';
|
import { name } from 'file-loader';
|
||||||
|
|
||||||
@ -708,11 +708,20 @@ export const newHttpRequest = (params) => (dispatch, getState) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const parts = splitOnFirst(requestUrl, '?');
|
const parts = splitOnFirst(requestUrl, '?');
|
||||||
const params = parseQueryParams(parts[1]);
|
const queryParams = parseQueryParams(parts[1]);
|
||||||
each(params, (urlParam) => {
|
each(queryParams, (urlParam) => {
|
||||||
urlParam.enabled = true;
|
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 = {
|
const item = {
|
||||||
uid: uuid(),
|
uid: uuid(),
|
||||||
type: requestType,
|
type: requestType,
|
||||||
|
Loading…
Reference in New Issue
Block a user