-
Notifications
You must be signed in to change notification settings - Fork 8
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
typescript error: get() params is not optional, per_page param is not available in other endpoints #25
Comments
Hi, @coycoylaniba. Can y give an example what endpoits those param is not available, please? Because in my test it was. Let me check it please. Thanks |
this end points node_modules/woocommerce-rest-ts-api/dist/src/typesANDinterfaces.d.ts: |
Get params should be optional BREAKING CHANGE: Params must be optional since we could use the endpoit with/without it #25
# [6.0.0](v5.0.10...v6.0.0) (2023-03-18) ### Bug Fixes * **component:** params should be optional ([9284915](9284915)), closes [#25](#25) ### BREAKING CHANGES * **component:** Params must be optional since we could use the endpoit with/without it
Check the latest version and let me know @coycoylaniba Thank you. |
hello sir, the params type error is fixed. but i have another problem, if i do "products/:productId" |
For while, if you want to use it like that is not possible, you would have to use it as a Parameter, in my opinion, it becomes a bit clear than direct if not leave your thoughts about that. Thanks @coycoylaniba |
oh okay thanks, will try it |
@coycoylaniba just to know. |
get parameters should be optional
api.get("endpoint")
Expected 2 arguments, but got 1. index.d.ts(15, 52): An argument for 'params' was not provided.
per_page is not available in other endpoints aside from webhook (which is webhook is not in the endpoints either)
Argument of type '{ status: string; per_page: number; }' is not assignable to parameter of type 'WooRestApiParams'. Object literal may only specify known properties, and 'per_page' does not exist in type 'WooRestApiParams'.
package.json
"woocommerce-rest-ts-api": "^2.0.0",
The text was updated successfully, but these errors were encountered: