Answer the question
In order to leave comments, you need to log in
What type to specify at Model?
I use sequelize.
Pulling data from the database:
const user = await User.findOne({where: {username}});
But if you turn to user.id or user.username, then typescript swears that there is no such data in the Model.
How can I enter this data or extend the Model?
Answer the question
In order to leave comments, you need to log in
I advise you to take the sequelize-typescript package , where in the dock it is immediately described how to declare your model and expand it with your fields, and all this with the help of classes and decorators
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question