import Route from '@ember/routing/route';
import '../../css/card-pay/balances.css';
import * as short from 'short-uuid';

export default class CardPayTabBaseRoute extends Route {
  queryParams = {
    flow: {
      refreshModel: true,
    },
    workflowPersistenceId: {
      refreshModel: true,
    },
  };
  model(params: any, transition: any) {
    if (params.flow && !params.workflowPersistenceId) {
      // TODO: remove me once all flows have persistence support
      if (params.flow !== 'deposit' && params.flow !== 'issue-prepaid-card')
        return;

      transition.abort();
      this.transitionTo(this.routeName, {
        queryParams: {
          flow: params.flow,
          workflowPersistenceId: short.generate(),
        },
      });
    }
  }
}

import Route from '@ember/routing/route';
import '../../css/card-pay/balances.css';
import * as short from 'short-uuid';

export default class CardPayTabBaseRoute extends Route {
  queryParams = {
    flow: {
      refreshModel: true,
    },
    workflowPersistenceId: {
      refreshModel: true,
    },
  };
  model(params: any, transition: any) {
    if (params.flow && !params.workflowPersistenceId) {
      // TODO: remove me once all flows have persistence support
      if (
        params.flow !== 'deposit' &&
        params.flow !== 'issue-prepaid-card' &&
        params.flow !== 'create-merchant'
      )
        return;

      transition.abort();
      this.transitionTo(this.routeName, {
        queryParams: {
          flow: params.flow,
          workflowPersistenceId: short.generate(),
        },
      });
    }
  }
}

Update guard since create-merchant flow has persistence now
Update guard since create-merchant flow has persistence now
