Closed Omar-V2 closed 8 months ago
@Omar-V2 you can define your own request interface with properly typed params, ie
interface CustomRequest extends Request {
params: {
id: string;
};
}
and use it instead of Request as generic param and run argument type
Firstly, thanks for the nice library!
When we define a class which implements the
SubjectBeforeFilterHook
as outlined in the readme, the params object that is pulled fromRequest
seems to haveany
typed which is not ideal. Is this the intended behaviour or am I doing something wrong here?I also inspected the example code in this repo under: https://github.com/getjerry/nest-casl/blob/master/src/__specs__/app/post/post.hook.ts#L11 and noticed the same issue.
Is there a way to have this typed?
Thanks!