Skip to content

Commit

Permalink
Merge pull request Expensify#44407 from Expensify/Rory-UseConstantFor…
Browse files Browse the repository at this point in the history
…SwitchToOldDot

[No QA] Use constant for SwitchToOldDot
  • Loading branch information
roryabraham authored Jun 26, 2024
2 parents d047467 + d7ec119 commit 8f3e925
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
11 changes: 6 additions & 5 deletions src/libs/API/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -560,15 +560,16 @@ type ReadCommandParameters = {
};

const SIDE_EFFECT_REQUEST_COMMANDS = {
ACCEPT_SPOTNANA_TERMS: 'AcceptSpotnanaTerms',
AUTHENTICATE_PUSHER: 'AuthenticatePusher',
OPEN_REPORT: 'OpenReport',
OPEN_OLD_DOT_LINK: 'OpenOldDotLink',
REVEAL_EXPENSIFY_CARD_DETAILS: 'RevealExpensifyCardDetails',
GENERATE_SPOTNANA_TOKEN: 'GenerateSpotnanaToken',
GET_MISSING_ONYX_MESSAGES: 'GetMissingOnyxMessages',
JOIN_POLICY_VIA_INVITE_LINK: 'JoinWorkspaceViaInviteLink',
OPEN_OLD_DOT_LINK: 'OpenOldDotLink',
OPEN_REPORT: 'OpenReport',
RECONNECT_APP: 'ReconnectApp',
GENERATE_SPOTNANA_TOKEN: 'GenerateSpotnanaToken',
ACCEPT_SPOTNANA_TERMS: 'AcceptSpotnanaTerms',
REVEAL_EXPENSIFY_CARD_DETAILS: 'RevealExpensifyCardDetails',
SWITCH_TO_OLD_DOT: 'SwitchToOldDot',
} as const;

type SideEffectRequestCommand = ValueOf<typeof SIDE_EFFECT_REQUEST_COMMANDS>;
Expand Down
3 changes: 2 additions & 1 deletion src/libs/actions/ExitSurvey.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type {OnyxUpdate} from 'react-native-onyx';
import Onyx from 'react-native-onyx';
import * as API from '@libs/API';
import {SIDE_EFFECT_REQUEST_COMMANDS} from '@libs/API/types';
import ONYXKEYS from '@src/ONYXKEYS';
import REASON_INPUT_IDS from '@src/types/form/ExitSurveyReasonForm';
import type {ExitReason} from '@src/types/form/ExitSurveyReasonForm';
Expand Down Expand Up @@ -67,7 +68,7 @@ function switchToOldDot() {

// eslint-disable-next-line rulesdir/no-api-side-effects-method
return API.makeRequestWithSideEffects(
'SwitchToOldDot',
SIDE_EFFECT_REQUEST_COMMANDS.SWITCH_TO_OLD_DOT,
{
reason: exitReason,
surveyResponse: exitSurveyResponse,
Expand Down

0 comments on commit 8f3e925

Please sign in to comment.