Skip to content

Commit

Permalink
Merge pull request #587 from newfold-labs/fix/old-flow-in-events
Browse files Browse the repository at this point in the history
Remove `flow` param for Events API requests
  • Loading branch information
arunshenoy99 authored Jun 27, 2024
2 parents c41b076 + bf15e58 commit 4ec7be5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions .github/workflows/lint-check-php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
types: [opened, edited, reopened, ready_for_review]
paths:
- '**.php'
- '!build/**/*.php'
workflow_dispatch:

concurrency:
Expand Down
4 changes: 2 additions & 2 deletions src/OnboardingSPA/utils/api/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import {
migrateRestBase,
} from '../../../constants';

export const onboardingRestURL = ( api ) => {
export const onboardingRestURL = ( api, includeFlow = true ) => {
return (
`${ onboardingRestBase }/${ api }` +
( window.nfdOnboarding?.currentFlow
( includeFlow && window.nfdOnboarding?.currentFlow
? `&flow=${ window.nfdOnboarding.currentFlow }`
: '' )
);
Expand Down
4 changes: 2 additions & 2 deletions src/onboarding.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ if ( runtimeDataExists ) {
HiiveAnalytics.initialize( {
namespace: CATEGORY,
urls: {
single: onboardingRestURL( 'events' ),
batch: onboardingRestURL( 'events/batch' ),
single: onboardingRestURL( 'events', false ),
batch: onboardingRestURL( 'events/batch', false ),
},
settings: {
debounce: {
Expand Down
4 changes: 2 additions & 2 deletions tests/cypress/integration/wp-module-support/EventsApi.cy.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const APIList = {
events_api_general_onb: '/index.php?rest_route=%2Fnewfold-onboarding%2Fv1%2Fevents%2Fbatch&flow=wp-setup&_locale=user',
events_api_ecomm: '/index.php?rest_route=%2Fnewfold-onboarding%2Fv1%2Fevents%2Fbatch&flow=ecommerce&_locale=user'
events_api_general_onb: '/index.php?rest_route=%2Fnewfold-onboarding%2Fv1%2Fevents%2Fbatch&_locale=user',
events_api_ecomm: '/index.php?rest_route=%2Fnewfold-onboarding%2Fv1%2Fevents%2Fbatch&_locale=user'
};

export const EventsAPI = ( events_name, card_val, api_name ) => {
Expand Down

0 comments on commit 4ec7be5

Please sign in to comment.