Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finale does not support the paranoid option #63

Open
danieldilly opened this issue Feb 6, 2020 · 2 comments
Open

Finale does not support the paranoid option #63

danieldilly opened this issue Feb 6, 2020 · 2 comments

Comments

@danieldilly
Copy link

When creating a resource with Finale, there should be an option to set paranoid to true or false. Sequelize has built in support for soft-deletes with this option, but finale-rest doesn't give you any way to pass it through.

@tommybananas
Copy link
Owner

This is something you set on your sequelize instance and on the model instance that you pass into sequelize, and is totally transparent to finale.

@danieldilly
Copy link
Author

That is not entirely correct. Please see the documentation here.

Setting paranoid on the model simply adds the deletedAt field and makes deletes not happen. However, there is another paranoid option that you pass to queries such as the one your library uses (findAndCountAll) that instructs the query whether or not to return deleted items.

I actually updated your library to support this feature. It's simply a matter of passing a pranoid option to your Resource constructor (while setting a default of paranoid:true in your lodash defaults method) and passint that option value through in your base.js and list.js files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants