Skip to content

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

Merged
farnabaz merged 1 commit into
nuxt:mainfrom
nobkd:docs/api-routes-_params
Aug 22, 2022
Merged

docs(querying): add _params to api routes#1463
farnabaz merged 1 commit into
nuxt:mainfrom
nobkd:docs/api-routes-_params

Conversation

@nobkd

Copy link
Copy Markdown
Contributor

🔗 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

netlifyBot commented Aug 18, 2022

Copy link
Copy Markdown

Deploy Preview for nuxt-content ready!

Built without sensitive environment variables

NameLink
🔨 Latest commitc502144
🔍 Latest deploy loghttps://app.netlify.com/sites/nuxt-content/deploys/62fe0b402ae04e00086f9d27
😎 Deploy Previewhttps://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
Copy Markdown
ContributorAuthor

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
Copy Markdown
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:mainAug 22, 2022
@nobkd
nobkd deleted the docs/api-routes-_params branch August 22, 2022 10:07
@farnabazfarnabaz mentioned this pull request Sep 2, 2022
farnabaz pushed a commit that referenced this pull request Sep 7, 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.

2 participants

@nobkd@farnabaz