nartc/nest-mean

error TS2304: Cannot find name 'T'

fea17e86 opened this issue · 4 comments

Hi

In src/api/models/base.model.ts(4,6) @pre is used with the generic type T:

@pre<T>('findOneAndUpdate', function() {

Typescript reports the error src/api/models/base.model.ts(4,6): error TS2304: Cannot find name 'T'. Is there a fix for that?

I just replaced
@pre<T>('findOneAndUpdate', fuction() { ...

with

@pre<any>('findOneAndUpdate', fuction() { ...

and so far it seems to work OK.

I Have the same problem as well :/

nartc commented

@fea17e86 @cesar3030 You can just remove the generic. I put the generic there because it was required at the time I made this tutorial. But it seems that it's no longer required.

@nartc Thank you!