next-drupal icon indicating copy to clipboard operation
next-drupal copied to clipboard

getMenu with addFields not working

Open Kaushikdugar opened this issue 1 year ago • 1 comments

I want to pull limited fields and only the tree for the getMenu. What is the way to achieve the same. Tried few things as below but did not worked , it returns all fields under items and tree objects. Is there any way to limit to get only tree results with limited set of fields

const navpageMenuParams = new DrupalJsonApiParams().addFields("menu--menu", [ "id", "title", ]); let navData = await drupal.getMenu("navigation", { params: navpageMenuParams.getQueryObject(), });

Kaushikdugar avatar Jul 22 '23 11:07 Kaushikdugar

@Kaushikdugar try to edit the resource overrides: /admin/config/services/jsonapi/resource_types

MathiasGmeiner avatar Aug 08 '23 11:08 MathiasGmeiner