Skip to content

fix(queryContent): use path argument as prefix if there is another condition#1612

Merged
farnabaz merged 2 commits into
mainfrom
fix/query-content-path
Oct 18, 2022
Merged

fix(queryContent): use path argument as prefix if there is another condition#1612
farnabaz merged 2 commits into
mainfrom
fix/query-content-path

Conversation

@farnabaz

Copy link
Copy Markdown
Member

🔗 Linked issue

resolves #1565

❓ 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

Currently if user passes the path argument to queryContent composable and call findOne, it will look for the exact match for that path.
This is acceptable behaviour, when user wants to find a single content without additional condition.

But when user provides another condition using where function, we should use the path as a prefix matcher, otherwise the result will be empty all the time.

📝 Checklist

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

@netlify

netlify Bot commented Oct 18, 2022

Copy link
Copy Markdown

Deploy Preview for nuxt-content ready!

Name Link
🔨 Latest commit 4dfd01b
🔍 Latest deploy log https://app.netlify.com/sites/nuxt-content/deploys/634ec2762936fc000792d8bd
😎 Deploy Preview https://deploy-preview-1612--nuxt-content.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@farnabaz farnabaz requested a review from atinux October 18, 2022 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants