I can not import model in route typescript

-1

PS: Apart from the info below, here is the source: link

The question is, why can not I access "User" which is a model for mongoose from a route?

That's how I have the router.

As you can see, User gives me an error "Can not find name 'User" "says.

The User model is like this.

Thank you very much !!!

    
asked by Jesús Salas 05.12.2018 в 14:26
source

1 answer

0

SOLUTION IN THIS THREAD: link

I needed to have an interface in ts.

    
answered by 06.12.2018 / 13:59
source