From 5cf12aec7efc1926909d4fbaaee81361f1caac23 Mon Sep 17 00:00:00 2001 From: Pooja Belaramani Date: Mon, 6 Jan 2025 18:14:17 +0530 Subject: [PATCH] fixes --- .../CollectionSettings/Auth/OAuth2/AuthorizationCode/index.js | 2 +- .../CollectionSettings/Auth/OAuth2/ClientCredentials/index.js | 2 +- .../src/components/CollectionSettings/Auth/OAuth2/index.js | 2 +- .../src/components/CollectionSettings/Headers/index.js | 2 +- .../src/components/CollectionSettings/Script/index.js | 2 +- packages/bruno-cli/src/utils/collection.js | 4 ++-- packages/bruno-electron/src/utils/collection.js | 4 ++-- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/bruno-app/src/components/CollectionSettings/Auth/OAuth2/AuthorizationCode/index.js b/packages/bruno-app/src/components/CollectionSettings/Auth/OAuth2/AuthorizationCode/index.js index 3539d510e2..5dbea5e4bd 100644 --- a/packages/bruno-app/src/components/CollectionSettings/Auth/OAuth2/AuthorizationCode/index.js +++ b/packages/bruno-app/src/components/CollectionSettings/Auth/OAuth2/AuthorizationCode/index.js @@ -14,7 +14,7 @@ const OAuth2AuthorizationCode = ({ collection }) => { const dispatch = useDispatch(); const { storedTheme } = useTheme(); - const oAuth = collection.draft ? get(collection, 'draft.request.auth.oauth', {}) : get(collection, 'root.request.auth.oauth2', {}); + const oAuth = collection.draft ? get(collection, 'draft.request.auth.oauth2', {}) : get(collection, 'root.request.auth.oauth2', {}); const handleRun = async () => { dispatch(sendCollectionOauth2Request(collection.uid)); diff --git a/packages/bruno-app/src/components/CollectionSettings/Auth/OAuth2/ClientCredentials/index.js b/packages/bruno-app/src/components/CollectionSettings/Auth/OAuth2/ClientCredentials/index.js index aaae3b5b22..9447a6dd05 100644 --- a/packages/bruno-app/src/components/CollectionSettings/Auth/OAuth2/ClientCredentials/index.js +++ b/packages/bruno-app/src/components/CollectionSettings/Auth/OAuth2/ClientCredentials/index.js @@ -12,7 +12,7 @@ const OAuth2ClientCredentials = ({ collection }) => { const dispatch = useDispatch(); const { storedTheme } = useTheme(); - const oAuth = collection.draft ? get(collection, 'draft.request.auth.oauth', {}) : get(collection, 'root.request.auth.oauth2', {}); + const oAuth = collection.draft ? get(collection, 'draft.request.auth.oauth2', {}) : get(collection, 'root.request.auth.oauth2', {}); const handleRun = async () => { dispatch(sendCollectionOauth2Request(collection.uid)); diff --git a/packages/bruno-app/src/components/CollectionSettings/Auth/OAuth2/index.js b/packages/bruno-app/src/components/CollectionSettings/Auth/OAuth2/index.js index 2bf906a120..ee01d41a04 100644 --- a/packages/bruno-app/src/components/CollectionSettings/Auth/OAuth2/index.js +++ b/packages/bruno-app/src/components/CollectionSettings/Auth/OAuth2/index.js @@ -24,7 +24,7 @@ const grantTypeComponentMap = (grantType, collection) => { }; const OAuth2 = ({ collection }) => { - const oAuth = collection.draft ? get(collection, 'draft.request.auth.oauth', {}) : get(collection, 'root.request.auth.oauth2', {}); + const oAuth = collection.draft ? get(collection, 'draft.request.auth.oauth2', {}) : get(collection, 'root.request.auth.oauth2', {}); return ( diff --git a/packages/bruno-app/src/components/CollectionSettings/Headers/index.js b/packages/bruno-app/src/components/CollectionSettings/Headers/index.js index c1bc16ca20..63c3a4fafe 100644 --- a/packages/bruno-app/src/components/CollectionSettings/Headers/index.js +++ b/packages/bruno-app/src/components/CollectionSettings/Headers/index.js @@ -19,7 +19,7 @@ const headerAutoCompleteList = StandardHTTPHeaders.map((e) => e.header); const Headers = ({ collection }) => { const dispatch = useDispatch(); const { storedTheme } = useTheme(); - const headers = collection.draft ? get(collection, 'draft.request.headers') : get(collection, 'root.request.headers', []); + const headers = collection.draft ? get(collection, 'draft.request.headers', []) : get(collection, 'root.request.headers', []); const addHeader = () => { dispatch( diff --git a/packages/bruno-app/src/components/CollectionSettings/Script/index.js b/packages/bruno-app/src/components/CollectionSettings/Script/index.js index 839b79afe6..8a69aacdf8 100644 --- a/packages/bruno-app/src/components/CollectionSettings/Script/index.js +++ b/packages/bruno-app/src/components/CollectionSettings/Script/index.js @@ -9,7 +9,7 @@ import StyledWrapper from './StyledWrapper'; const Script = ({ collection }) => { const dispatch = useDispatch(); - const requestScript = collection.draft ? get(collection, 'draft.request.script.res', '') : get(collection, 'root.request.script.req', ''); + const requestScript = collection.draft ? get(collection, 'draft.request.script.req', '') : get(collection, 'root.request.script.req', ''); const responseScript = collection.draft ? get(collection, 'draft.request.script.res', '') : get(collection, 'root.request.script.res', ''); const { displayedTheme } = useTheme(); diff --git a/packages/bruno-cli/src/utils/collection.js b/packages/bruno-cli/src/utils/collection.js index a8b97df64b..1e0eed2193 100644 --- a/packages/bruno-cli/src/utils/collection.js +++ b/packages/bruno-cli/src/utils/collection.js @@ -113,8 +113,8 @@ const mergeVars = (collection, request, requestTreePath) => { }; const mergeScripts = (collection, request, requestTreePath, scriptFlow) => { - let collectionPreReqScript = collection.draft ? get(collection, 'draft.request.script.req') : get(collection, 'root.request.script.req', ''); - let collectionPostResScript = collection.draft ? get(collection, 'draft.request.script.res') : get(collection, 'root.request.script.res', ''); + let collectionPreReqScript = collection.draft ? get(collection, 'draft.request.script.req', '') : get(collection, 'root.request.script.req', ''); + let collectionPostResScript = collection.draft ? get(collection, 'draft.request.script.res', '') : get(collection, 'root.request.script.res', ''); let collectionTests = collection.draft ? get(collection, 'draft.request.tests', '') : get(collection, 'root.request.tests', ''); let combinedPreReqScript = []; diff --git a/packages/bruno-electron/src/utils/collection.js b/packages/bruno-electron/src/utils/collection.js index 3a98ef57b5..881c7e90ea 100644 --- a/packages/bruno-electron/src/utils/collection.js +++ b/packages/bruno-electron/src/utils/collection.js @@ -81,7 +81,7 @@ const mergeVars = (collection, request, requestTreePath) => { } let resVars = new Map(); - let collectionResponseVars = collection.draft ? get(collection, 'draft.request.vars.res') : get(collection, 'root.request.vars.res', []); + let collectionResponseVars = collection.draft ? get(collection, 'draft.request.vars.res', []) : get(collection, 'root.request.vars.res', []); collectionResponseVars.forEach((_var) => { if (_var.enabled) { resVars.set(_var.name, _var.value); @@ -118,7 +118,7 @@ const mergeVars = (collection, request, requestTreePath) => { const mergeScripts = (collection, request, requestTreePath, scriptFlow) => { let collectionPreReqScript = collection.draft ? get(collection, 'draft.request.script.req', '') : get(collection, 'root.request.script.req', ''); let collectionPostResScript = collection.draft ? get(collection, 'draft.request.script.res', '') : get(collection, 'root.request.script.res', ''); - let collectionTests = collection.draft ? get(collection, 'draft.request.tests') : get(collection, 'root.request.tests', ''); + let collectionTests = collection.draft ? get(collection, 'draft.request.tests', '') : get(collection, 'root.request.tests', ''); let combinedPreReqScript = []; let combinedPostResScript = [];