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

getMenu function fails to fetch menu. #752

Open
Danishkhurshid opened this issue May 2, 2024 · 0 comments
Open

getMenu function fails to fetch menu. #752

Danishkhurshid opened this issue May 2, 2024 · 0 comments
Labels
area: next-drupal bug Something isn't working

Comments

@Danishkhurshid
Copy link

Package containing the bug

next-drupal (NPM package)

Describe the bug

I am getting an error Error: Resource of type 'menu_items' not found. on trying to fetch menus with getMenu.

After debugging i see that buildEndpoint generates /jsonapi as an endpoint to fetch menus rather than /jsonapi/menu_items/{menu}

Fix:
getMenu should call the buildEndpoint as below by concatenating the path rather than passing menu_items as a resourceType.

   const endpoint = await this.buildEndpoint({
      locale:
        options?.locale !== options?.defaultLocale ? options.locale : undefined,
      path: `/menu_items/${menuName}`,
      searchParams: options.params,
    })
@Danishkhurshid Danishkhurshid added bug Something isn't working triage A new issue that needs triage labels May 2, 2024
@JohnAlbin JohnAlbin added area: next-drupal and removed triage A new issue that needs triage labels May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: next-drupal bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants