From d7ec11900afad6ebc244e310a8f867f770560400 Mon Sep 17 00:00:00 2001 From: rory Date: Tue, 25 Jun 2024 12:33:11 -0700 Subject: [PATCH] Use constant for SwitchToOldDot --- src/libs/API/types.ts | 11 ++++++----- src/libs/actions/ExitSurvey.ts | 3 ++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/libs/API/types.ts b/src/libs/API/types.ts index 63473a4b2c68..9ce11ac4c26f 100644 --- a/src/libs/API/types.ts +++ b/src/libs/API/types.ts @@ -556,15 +556,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; diff --git a/src/libs/actions/ExitSurvey.ts b/src/libs/actions/ExitSurvey.ts index 67ac39d81bd6..12dc57f1dfde 100644 --- a/src/libs/actions/ExitSurvey.ts +++ b/src/libs/actions/ExitSurvey.ts @@ -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'; @@ -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,