Skip to content

Commit

Permalink
Merge pull request #33776 from Expensify/ionatan_devenvparam
Browse files Browse the repository at this point in the history
Add dev env param
  • Loading branch information
flodnv authored Jan 8, 2024
2 parents 5f4a273 + 336332a commit 900ce72
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/libs/Network/enhanceParameters.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import * as Environment from '@libs/Environment/Environment';
import getPlatform from '@libs/getPlatform';
import CONFIG from '@src/CONFIG';
import * as NetworkStore from './NetworkStore';
Expand Down Expand Up @@ -37,6 +38,8 @@ export default function enhanceParameters(command: string, parameters: Record<st
// Include current user's email in every request and the server logs
finalParameters.email = parameters.email ?? NetworkStore.getCurrentUserEmail();

finalParameters.isFromDevEnv = Environment.isDevelopment();

// idempotencyKey declared in JS is front-end-only. We delete it here so it doesn't interfere with idempotency in other layers.
delete finalParameters.idempotencyKey;

Expand Down
2 changes: 2 additions & 0 deletions tests/unit/enhanceParametersTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ test('Enhance parameters adds correct parameters for Log command with no authTok
testParameter: 'test',
api_setCookie: false,
email,
isFromDevEnv: true,
platform: 'ios',
referer: CONFIG.EXPENSIFY.EXPENSIFY_CASH_REFERER,
});
Expand All @@ -36,6 +37,7 @@ test('Enhance parameters adds correct parameters for a command that requires aut
testParameter: 'test',
api_setCookie: false,
email,
isFromDevEnv: true,
platform: 'ios',
authToken,
referer: CONFIG.EXPENSIFY.EXPENSIFY_CASH_REFERER,
Expand Down

0 comments on commit 900ce72

Please sign in to comment.