We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
in docs there is an example to override a method like this
get base(): CrudController<Hero> { return this; } @Override() getMany( @ParsedRequest() req: CrudRequest, ) { return this.base.getManyBase(req); }
however, the base methods such as getManyBase is typed to return a promise or undefined so, the previous snippet makes TS to give this error
getManyBase
Cannot invoke an object which is possibly 'undefined'.ts(2722)
we can make an ugly workaround and edit our code to be
return this.base.getManyBase?.(req);
this also makes TS complain again because the overrides method i.e. getMany() should return Promise only, not promise or undefined
getMany()
The text was updated successfully, but these errors were encountered:
@its-dibo Which TS version are you using?
Sorry, something went wrong.
Which TS version are you using?
5.4.5
No branches or pull requests
in docs there is an example to override a method like this
however, the base methods such as
getManyBase
is typed to return a promise or undefinedso, the previous snippet makes TS to give this error
we can make an ugly workaround and edit our code to be
this also makes TS complain again because the overrides method i.e.
getMany()
should return Promise only, not promise or undefinedThe text was updated successfully, but these errors were encountered: