tommybananas / finale

Create flexible REST endpoints and controllers from Sequelize models in your Express app
188 stars 36 forks source link

How to add another options item while creating an model instance? #3

Closed vafrcor closed 6 years ago

vafrcor commented 6 years ago

I have custom Hook logic at Sequelize Model and need a custom options while creating an instance. see this picture for current Finale controller. epilogue-finale-controller-create-options

tommybananas commented 6 years ago

I'm not sure I understand the question. Can you expand your explanation?

If you need to pass extra data, you can add url query parameters or extra body parameters (json, etc) that you can parse from res.body or res.query (for express)

mubaidr commented 6 years ago

@tommybananas I think he wants to override the default get method for a resource. As by-default it will return all objects in that model, so he wants to introduce some query to limit results.

@vafrcor I am defining custom routes in my nodejs app for these type of resources.

mubaidr commented 6 years ago

@vafrcor Milestones might be of some interests for you.

tommybananas commented 6 years ago

Milestones or custom routes are probably the best bet here, closing for now