Open
Description
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,
})