Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

route url is set to '/' when patching route without providing path #3886

Closed
mgochmuradov opened this issue May 9, 2020 · 1 comment
Closed

Comments

@mgochmuradov
Copy link
Contributor

route url is set to '/' when patching route without providing path

this.store.dispatch(new PatchRouteByName(
  '::Menu:Documents',
  {
    //path: 'documents/list', <- without this route url will be set to '/'
    children: menu
  }
));

I think the problem is at config.state.ts

function patchRouteDeep(
  routes: ABP.FullRoute[],
  name: string,
  newValue: Partial<ABP.FullRoute>,
  parentUrl: string = '',
): ABP.FullRoute[] {
  routes = routes.map(route => {
    if (route.name === name) {
      newValue.url = `${parentUrl}/${(!newValue.path && newValue.path === '' // Should be || instead of &&
        ? route.path
        : newValue.path) || ''}`;
@mehmet-erim
Copy link
Contributor

Thanks for reporting @mgochmuradov

mehmet-erim added a commit that referenced this issue May 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants