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

docs(querying): add _params to api routes #1463

Merged
merged 1 commit into from
Aug 22, 2022
Merged

docs(querying): add _params to api routes #1463

merged 1 commit into from
Aug 22, 2022

Conversation

nobkd
Copy link
Contributor

@nobkd nobkd commented Aug 18, 2022

πŸ”— Linked issue

❓ 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

Added example for _params api route endpoint.

πŸ“ Checklist

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

@netlify
Copy link

netlify bot commented Aug 18, 2022

βœ… Deploy Preview for nuxt-content ready!

Built without sensitive environment variables

Name Link
πŸ”¨ Latest commit c502144
πŸ” Latest deploy log https://app.netlify.com/sites/nuxt-content/deploys/62fe0b402ae04e00086f9d27
😎 Deploy Preview https://deploy-preview-1463--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.

@nobkd
Copy link
Contributor Author

nobkd commented Aug 18, 2022

Feel free to provide a better example.
I think it's necessary to provide documentation for the _params endpoint to show how to make complex requests with api routes, instead of just explaining how it's possible with the queryContent function.

@farnabaz
Copy link
Member

Thanks for the PR @nobkd,
Before we documented advanced usages of _params we need to expose util to encode/decode these as query params. These utils are responsible for preparing regex for query params.

I'm merging this, and updating docs once we exposed utils.

@farnabaz farnabaz merged commit 46723ef into nuxt:main Aug 22, 2022
@nobkd nobkd deleted the docs/api-routes-_params branch August 22, 2022 10:07
@farnabaz farnabaz mentioned this pull request Sep 2, 2022
farnabaz pushed a commit that referenced this pull request Sep 7, 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.

2 participants