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

fix(ContentNavigation): exception on query prop #1205

Closed
wants to merge 3 commits into from

Conversation

harlan-zw
Copy link
Contributor

@harlan-zw harlan-zw commented Jun 3, 2022

πŸ”— Linked issue

#1156

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

The specified type of the query prop is QueryBuilderParams. When you provide the query with this type an exception is thrown.

The change fixes the ContentNavigation component using the prop type provided. This is the only component affected by this.

Example:

<script lang="ts" setup>
const contentQuery = {
  where: [
    { _path: /^\/content/ },
  ],
}
</script>

<template>
<ContentNavigation v-slot="{ navigation }" :query="contentQuery">
  <NuxtLink
    v-for="link of navigation"
    :key="link._path"
    :to="link._path"
  >
    {{ link.navTitle || link.title }}
  </NuxtLink>
</ContentNavigation>
</template>

This exception is thrown.

image

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@netlify
Copy link

netlify bot commented Jun 3, 2022

‼️ Deploy request for nuxt-content rejected.

Name Link
πŸ”¨ Latest commit 282f24b

@Atinux
Copy link
Member

Atinux commented Jun 3, 2022

Thank you!

It would be nice to be able to add tests to avoid any potential regressions in the future (can be added later no pressure)

Tahul added a commit to harlan-zw/nuxt-content-fork that referenced this pull request Jun 3, 2022
Tahul added a commit to harlan-zw/nuxt-content-fork that referenced this pull request Jun 3, 2022
@Tahul
Copy link
Contributor

Tahul commented Jun 3, 2022

Hey @harlan-zw ;

I applied the changes from this PR on #1206 ; as I was working on adding a test for ! πŸ™‚

I'll be closing this one in favor of #1206, but thank you so much for this!

@Tahul Tahul closed this Jun 3, 2022
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.

None yet

3 participants