Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Fully type "hander()" in the api routes #4

Closed
johannesschaffer opened this issue Apr 6, 2023 · 1 comment
Closed

Fully type "hander()" in the api routes #4

johannesschaffer opened this issue Apr 6, 2023 · 1 comment
Assignees

Comments

@johannesschaffer
Copy link

The parameters (req & res) of the api routes in the "pages" dir (which are autogenerated by next-payload) don't have types. This makes it hard to use with Typescript strict mode (which Next.js comes with by default).

@JarrodMFlesch
Copy link
Contributor

The code is now imported from the package, this way code changes can happen inside those handlers when the plugin is updated which is nice.

You will need to run yarn next-payload install and read through the updated readme!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants