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

findOrCreate should accept 'fields' to save #12325

Closed
2 of 6 tasks
sonirico opened this issue May 29, 2020 · 3 comments
Closed
2 of 6 tasks

findOrCreate should accept 'fields' to save #12325

sonirico opened this issue May 29, 2020 · 3 comments
Labels
type: typescript For issues and PRs. Things that involve typescript, such as typings and intellisense.

Comments

@sonirico
Copy link
Contributor

sonirico commented May 29, 2020

Issue Description

Is your feature request related to a problem? Please describe.

CreateOptions has a optional property named 'fields' which describes which fields are writable, in order to prevent additional and/or malicious fields sent on payloads persisted in databases. However, FindOrCreateOptions does not provide such configuration to be set. Is that intentional?

Describe the solution you'd like

Some configuration flag to enable writes applicable to certain fields, as CreateOptions does.

Issue Template Checklist

Is this issue dialect-specific?

  • No. This issue is relevant to Sequelize as a whole.
  • Yes. This issue only applies to the following dialect(s): XXX, YYY, ZZZ

Would you be willing to resolve this issue by submitting a Pull Request?

  • Yes, I have the time and I know how to start.
  • Yes, I have the time but I don't know how to start, I would need guidance.
  • No, I don't have the time, although I believe I could do it if I had the time...
  • No, I don't have the time and I wouldn't even know how to start.
@sushantdhiman
Copy link
Contributor

findOrCreate does pass options to create method. I think typings can be improved. Please send a PR if you can spare some time

@sushantdhiman sushantdhiman added the type: typescript For issues and PRs. Things that involve typescript, such as typings and intellisense. label May 30, 2020
@sonirico
Copy link
Contributor Author

Ok, I will spare some time to do it this week.

@sushantdhiman
Copy link
Contributor

sushantdhiman commented Jun 7, 2020

Fixed by #12338, Thanks @sonirico

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: typescript For issues and PRs. Things that involve typescript, such as typings and intellisense.
Projects
None yet
Development

No branches or pull requests

2 participants