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

getPayload helper #785

Open
1 task done
danielkellyio opened this issue Jun 21, 2024 · 0 comments
Open
1 task done

getPayload helper #785

danielkellyio opened this issue Jun 21, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@danielkellyio
Copy link

Describe the feature

Would be nice I think if h3 had a helper function like getPayload

Would work just like getQuery and readBody but would work for both depending on the request method and also include the route params

Here is a proof of concept for getPayload as a utility function:
https://stackblitz.com/edit/github-dbe8gu?file=server%2Futils%2Findex.ts

(uses Nuxt getRouterParams... not sure what that would be in h3)

Would also be great to have a getValidatedPayload version that works like the query and body counterparts.

Additional information

  • Would you be willing to help implement this feature?
@danielkellyio danielkellyio added the enhancement New feature or request label Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant