Skip to content

fix(ContentNavigation): exception on query prop - #1205

Closed
harlan-zw wants to merge 3 commits into
nuxt:mainfrom
harlan-zw:fix/content-nav-query
Closed

fix(ContentNavigation): exception on query prop#1205
harlan-zw wants to merge 3 commits into
nuxt:mainfrom
harlan-zw:fix/content-nav-query

Conversation

@harlan-zw

@harlan-zwharlan-zw commented Jun 3, 2022

Copy link
Copy Markdown
Contributor

🔗 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>
<ContentNavigationv-slot="{ navigation }" :query="contentQuery">
<NuxtLinkv-for="linkofnavigation"
: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

netlifyBot commented Jun 3, 2022

Copy link
Copy Markdown

‼️ Deploy request for nuxt-content rejected.

NameLink
🔨 Latest commit282f24b

@atinux

Copy link
Copy Markdown
Member

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

Tahul commented Jun 3, 2022

Copy link
Copy Markdown
Contributor

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!

@TahulTahul closed this Jun 3, 2022
Sign up for freeto 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.

3 participants

@harlan-zw@atinux@Tahul