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

Updater not working with certain models #307

Open
da-wallace opened this issue Aug 27, 2019 · 0 comments
Open

Updater not working with certain models #307

da-wallace opened this issue Aug 27, 2019 · 0 comments

Comments

@da-wallace
Copy link

da-wallace commented Aug 27, 2019

Expected behavior

Update the record as it normally does. It doesn't work with certain records because you're using _.each to loop through an object. This won't work when an object has a "length" property. Such as for box dimensions or product specs.

jashkenas/underscore#2407

Actual behavior

Get's undefined keys/values because the input is an object with a length property.

Failure Logs

No logs just fails to update the record.

Context

_.each shouldn't be used to loop through objects. Use _.forOwn as per the lo-dash documentation. In resource-updater.js.

  • Package Version: 3.3.3
  • Express Version: 4.16.2
  • Sequelize Version: 5.16.0
  • Database Dialect: postgres
  • Database Version: 9
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

1 participant