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

Content Loader API deleting slug field #12162

Closed
1 task done
datner opened this issue Oct 8, 2024 · 0 comments
Closed
1 task done

Content Loader API deleting slug field #12162

datner opened this issue Oct 8, 2024 · 0 comments
Assignees
Labels
5.0 beta Related to the Astro 5.0 beta feat: content layer Related to the Content Layer feature (scope)

Comments

@datner
Copy link

datner commented Oct 8, 2024

Astro Info

Astro                    v5.0.0-beta.4
Node                     v20.14.0
System                   macOS (arm64)
Package Manager          unknown (<- using pnpm, not sure why it's not recognized)
Output                   static
Adapter                  @astrojs/node (<- thats not correct 🤨, wut)
Integrations             @astrojs/react
                         @astrojs/tailwind
                         @astrojs/partytown

If this issue only occurs in one browser, which browser is a problem?

N/A

Describe the Bug

in a loader, when some datum includes a field named slug, it will be deleted

{
  load: async ({ parseData, .. }) => {
    const data = await parseData({
      id: '...',
      data: { .., slug: "foo" }
    }) // BOOM! expected `slug`, but was missing!
  }
}

What's the expected result?

to not have my data removed >:(
in a loader, when some datum includes a field named slug, it will be deleted

{
  load: async ({ parseData, .. }) => {
    const data = await parseData({
      id: '...',
      data: { .., slug: "foo" }
    }) // 👍👍👍 very good, I too have love for Gastropoda
  }
}

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-ug9hbd?file=src%2Fcontent%2Fconfig.ts

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Oct 8, 2024
@ascorbic ascorbic self-assigned this Oct 9, 2024
@ascorbic ascorbic added feat: content layer Related to the Content Layer feature (scope) 5.0 beta Related to the Astro 5.0 beta and removed needs triage Issue needs to be triaged labels Oct 9, 2024
@ascorbic ascorbic closed this as completed Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5.0 beta Related to the Astro 5.0 beta feat: content layer Related to the Content Layer feature (scope)
Projects
None yet
Development

No branches or pull requests

2 participants