mattkrea / sequelize-handlers

Auto-generate REST endpoints from Sequelize models
MIT License
9 stars 3 forks source link

Error invalidModel #2

Closed victorlm125 closed 6 years ago

victorlm125 commented 6 years ago

I have a problem with models and createRouter. Before call createRouter I check that the instance is correct but createRouter return an error of type 'InvalidModel'. My code is:

if (dbb['Alarm'] instanceof Sequelize.Model) console.log('Instance true'); --> Logs 'Instance true' const router = createRouter([dbb['Alarm']]); --> Returns InvalidModel error

mattkrea commented 6 years ago

Hi @victorlm125. What version of Sequelize are you using?

victorlm125 commented 6 years ago

Last one. 4.x

-----Mensaje original----- De: "Matthew Rea" notifications@github.com Enviado: ‎15/‎12/‎2017 22:52 Para: "mattkrea/sequelize-handlers" sequelize-handlers@noreply.github.com CC: "victorlm125" victorlm125@gmail.com; "Mention" mention@noreply.github.com Asunto: Re: [mattkrea/sequelize-handlers] Error invalidModel (#2)

Hi @victorlm125. What version of Sequelize are you using? — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

mattkrea commented 6 years ago

4.x introduces breaking changes. It seems to have broken all the tests too. Once I'm able to get those working I'll put out a new major version for Sequelize 4.x.

victorlm125 commented 6 years ago

Thanks.

Regards, Victor

-----Mensaje original----- De: "Matthew Rea" notifications@github.com Enviado: ‎16/‎12/‎2017 0:02 Para: "mattkrea/sequelize-handlers" sequelize-handlers@noreply.github.com CC: "victorlm125" victorlm125@gmail.com; "Mention" mention@noreply.github.com Asunto: Re: [mattkrea/sequelize-handlers] Error invalidModel (#2)

4.x introduces breaking changes. It seems to have broken all the tests too. Once I'm able to get those working I'll put out a new major version for Sequelize 4.x. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

mattkrea commented 6 years ago

@victorlm125 Pushed out 2.0.0-beta1. Give it a shot.

Thank you!