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

excluding_fields ignored when passing language #1229

Open
1 task done
christophby opened this issue Sep 11, 2024 · 0 comments
Open
1 task done

excluding_fields ignored when passing language #1229

christophby opened this issue Sep 11, 2024 · 0 comments
Labels
pending-author [Issue] Awaiting further information or action from the issue author pending-triage [Issue] Ticket is pending to be prioritised

Comments

@christophby
Copy link

Describe the issue you're facing

When using getStories, I want to exclude specific fields.

This works fine:

  const storyblokApi = getStoryblokApi();
  const result = await storyblokApi.getStories({
    with_tag: 'review',
    excluding_fields: 'richtext,body,metaTitle,metaDescription',
  });
  // -> ✅ `result?.data?.stories[0].content.richtext` doesn't exists

As soon as I add language, the field richtext is being returned.
body, metaTitle, metaDescription are still excluded.
The bad thing: richtext is the most important field which I really need to exclude.

  const result = await storyblokApi.getStories({
    with_tag: 'review',
    excluding_fields: 'richtext,body,metaTitle,metaDescription',
    language: 'it',
  });
  // -> ❌ `result?.data?.stories[0].content.richtext` exists

If it helps:

  • richtext is a translatable Richtext field

Same thing is happening whe using the API directly
GET https://api.storyblok.com/v2/cdn/stories?version=published&with_tag=review&excluding_fields=richtext,body,metaTitle,metaDescription&language=it

Reproduction

Steps to reproduce

See code in issue description

System Info

System:
    OS: macOS 14.6.1
    CPU: (8) arm64 Apple M1 Pro
    Memory: 314.47 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.8.0 - ~/.nvm/versions/node/v22.8.0/bin/node
    Yarn: 1.22.22 - ~/.nvm/versions/node/v22.8.0/bin/yarn
    npm: 10.8.2 - ~/.nvm/versions/node/v22.8.0/bin/npm
    Watchman: 2023.09.18.00 - /opt/homebrew/bin/watchman
  Browsers:
    Chrome: 128.0.6613.137
    Safari: 17.6

"@storyblok/react": "^3.0.14",
"next": "^14.2.8",
"react": "^18.3.1",

Used Package Manager

yarn

Error logs (Optional)

No response

Validations

@christophby christophby added pending-author [Issue] Awaiting further information or action from the issue author pending-triage [Issue] Ticket is pending to be prioritised labels Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending-author [Issue] Awaiting further information or action from the issue author pending-triage [Issue] Ticket is pending to be prioritised
Projects
None yet
Development

No branches or pull requests

1 participant