drag(drop(node))}>
diff --git a/packages/bruno-app/src/providers/ReduxStore/slices/collections/index.js b/packages/bruno-app/src/providers/ReduxStore/slices/collections/index.js
index 24ad23a8d..213761029 100644
--- a/packages/bruno-app/src/providers/ReduxStore/slices/collections/index.js
+++ b/packages/bruno-app/src/providers/ReduxStore/slices/collections/index.js
@@ -44,9 +44,8 @@ export const collectionsSlice = createSlice({
// this is used in scenarios where we want to know the last action performed on the collection
// and take some extra action based on that
// for example, when a env is created, we want to auto select it the env modal
- collection.importedAt = new Date().getTime()
+ collection.importedAt = new Date().getTime();
collection.lastAction = null;
- console.log(collection)
collapseCollection(collection);
addDepth(collection.items);
@@ -73,16 +72,16 @@ export const collectionsSlice = createSlice({
state.collections = filter(state.collections, (c) => c.uid !== action.payload.collectionUid);
},
sortCollections: (state, action) => {
- state.collectionSortOrder = action.payload.order
+ state.collectionSortOrder = action.payload.order;
switch (action.payload.order) {
case 'default':
- state.collections = state.collections.sort((a, b) => a.importedAt - b.importedAt)
+ state.collections = state.collections.sort((a, b) => a.importedAt - b.importedAt);
break;
case 'alphabetical':
- state.collections = state.collections.sort((a, b) => a.name.localeCompare(b.name))
+ state.collections = state.collections.sort((a, b) => a.name.localeCompare(b.name));
break;
case 'reverseAlphabetical':
- state.collections = state.collections.sort((a, b) => b.name.localeCompare(a.name))
+ state.collections = state.collections.sort((a, b) => b.name.localeCompare(a.name));
break;
}
},
diff --git a/packages/bruno-app/src/utils/codegenerator/har.js b/packages/bruno-app/src/utils/codegenerator/har.js
index ada2854d7..b48fbc3c7 100644
--- a/packages/bruno-app/src/utils/codegenerator/har.js
+++ b/packages/bruno-app/src/utils/codegenerator/har.js
@@ -30,12 +30,11 @@ const createHeaders = (headers, mode) => {
return headersArray;
};
-const createQuery = (url) => {
- const params = new URLSearchParams(url);
- return params.forEach((value, name) => {
+const createQuery = (queryParams = []) => {
+ return queryParams.map((param) => {
return {
- name,
- value
+ name: param.name,
+ value: param.value
};
});
};
@@ -57,28 +56,14 @@ const createPostData = (body) => {
}
};
-const createUrl = (request) => {
- let url = request.url;
- const variablePattern = /\{\{([^}]+)\}\}/g;
- const variables = request.url.match(variablePattern);
- if (variables) {
- variables.forEach((variable) => {
- const variableName = variable.replaceAll('{', '').replaceAll('}', '');
- const variableValue = request.vars.req.find((v) => v.name === variableName).value;
- url = url.replace(variable, variableValue);
- });
- }
- return url;
-};
-
export const buildHarRequest = (request) => {
return {
method: request.method,
- url: createUrl(request),
+ url: request.url,
httpVersion: 'HTTP/1.1',
cookies: [],
headers: createHeaders(request.headers, request.body.mode),
- queryString: createQuery(request.url),
+ queryString: createQuery(request.params),
postData: createPostData(request.body),
headersSize: 0,
bodySize: 0