Skip to content

Commit

Permalink
refactor(api-constants): Rename RoutingQueryResult => RoutingQueryCal…
Browse files Browse the repository at this point in the history
…lResult per PR feedback
  • Loading branch information
binh-dam-ibigroup committed Sep 14, 2023
1 parent c72cbc7 commit 8a0e6c9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/actions/api-constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const RoutingQueryResult = {
export const RoutingQueryCallResult = {
INVALID_MODE_SELECTION: 2,
INVALID_QUERY: 1,
SUCCESS: 0
Expand Down
8 changes: 4 additions & 4 deletions lib/actions/apiV2.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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
}
}

Expand Down
4 changes: 2 additions & 2 deletions lib/components/form/batch-settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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'
Expand Down

0 comments on commit 8a0e6c9

Please sign in to comment.