Skip to content

docs(building-pages): use 'type' instead of 'path' in getResource fun…#842

Open
bsanz-hiberuscom wants to merge 1 commit intochapter-three:mainfrom
bsanz-hiberuscom:2.0-docs-fix
Open

docs(building-pages): use 'type' instead of 'path' in getResource fun…#842
bsanz-hiberuscom wants to merge 1 commit intochapter-three:mainfrom
bsanz-hiberuscom:2.0-docs-fix

Conversation

@bsanz-hiberuscom
Copy link

@bsanz-hiberuscom bsanz-hiberuscom commented Feb 24, 2025

This pull request is for: (mark with an "x")

  • examples/*
  • modules/next
  • packages/next-drupal
  • starters/basic-starter
  • starters/graphql-starter
  • starters/pages-starter
  • Other

GitHub Issue: #841

  • I need help adding tests. (mark with an "x")
    Code changes need test coverage. If you don't know
    how to make tests, check this box to ask for help.

Description

In the building pages documentation, the drupal.getResource function was being called with the result of drupal.translatePath as its first parameter. However, this is incorrect because getResource requires the entity type as its first argument.

I've updated the documentation by replacing these calls with the correct entity type. The type is already stored in a constant:

const type = path.jsonapi.resourceName;

Now, `getResource` calls use this type as the first parameter.

@vercel
Copy link

vercel bot commented Feb 24, 2025

@borja-sanz-sanz is attempting to deploy a commit to the Chapter Three Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments