From 8a0e6c906d37de4c0a8359da6fde1f7d77544b44 Mon Sep 17 00:00:00 2001 From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com> Date: Thu, 14 Sep 2023 11:34:53 -0400 Subject: [PATCH] refactor(api-constants): Rename RoutingQueryResult => RoutingQueryCallResult per PR feedback --- lib/actions/api-constants.ts | 2 +- lib/actions/apiV2.js | 8 ++++---- lib/components/form/batch-settings.tsx | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/actions/api-constants.ts b/lib/actions/api-constants.ts index b47743b9b..bfa917885 100644 --- a/lib/actions/api-constants.ts +++ b/lib/actions/api-constants.ts @@ -1,4 +1,4 @@ -export const RoutingQueryResult = { +export const RoutingQueryCallResult = { INVALID_MODE_SELECTION: 2, INVALID_QUERY: 1, SUCCESS: 0 diff --git a/lib/actions/apiV2.js b/lib/actions/apiV2.js index 5c82ec36a..74d0e53d1 100644 --- a/lib/actions/apiV2.js +++ b/lib/actions/apiV2.js @@ -41,7 +41,7 @@ import { updateOtpUrlParams } from './api' import { rememberPlace } from './user' -import { RoutingQueryResult } from './api-constants' +import { RoutingQueryCallResult } from './api-constants' import { setItineraryView } from './ui' import { zoomToPlace } from './map' @@ -841,7 +841,7 @@ export function routingQuery(searchId = null, updateSearchInReducer) { // Don't permit a routing query if the query is invalid if (!queryIsValid(state)) { console.warn('Query is invalid. Aborting routing query', currentQuery) - return RoutingQueryResult.INVALID_QUERY + return RoutingQueryCallResult.INVALID_QUERY } const { @@ -1010,8 +1010,8 @@ export function routingQuery(searchId = null, updateSearchInReducer) { } return combinations.length === 0 - ? RoutingQueryResult.INVALID_MODE_SELECTION - : RoutingQueryResult.SUCCESS + ? RoutingQueryCallResult.INVALID_MODE_SELECTION + : RoutingQueryCallResult.SUCCESS } } diff --git a/lib/components/form/batch-settings.tsx b/lib/components/form/batch-settings.tsx index c005d05a1..15e3f95e8 100644 --- a/lib/components/form/batch-settings.tsx +++ b/lib/components/form/batch-settings.tsx @@ -26,7 +26,7 @@ import { ComponentContext } from '../../util/contexts' import { generateModeSettingValues } from '../../util/api' import { getActiveSearch, hasValidLocation } from '../../util/state' import { getFormattedMode } from '../../util/i18n' -import { RoutingQueryResult } from '../../actions/api-constants' +import { RoutingQueryCallResult } from '../../actions/api-constants' import { StyledIconWrapper } from '../util/styledIcon' import { @@ -169,7 +169,7 @@ function BatchSettings({ const routingQueryResult = routingQuery() // If mode combination is not valid (i.e. produced no query), alert the user. - if (routingQueryResult === RoutingQueryResult.INVALID_MODE_SELECTION) { + if (routingQueryResult === RoutingQueryCallResult.INVALID_MODE_SELECTION) { window.alert( intl.formatMessage({ id: 'components.BatchSettings.invalidModeSelection'