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

[*] Default Values - Field UID with defaultValue shows incorrect data on form #214

Closed
rodrigo4244 opened this issue Oct 16, 2018 · 3 comments
Labels

Comments

@rodrigo4244
Copy link

Expected behavior

UID field to have a correct default value or not have it and let Sequelize to handle the creation of UID.

Actual behavior

Currently the UID field is automatically populated with [object Object] which causes an error on the backend.

image

Failure Logs

[forest] 🌳🌳🌳  Unexpected error: invalid input syntax for type uuid: "[object Object]"
SequelizeDatabaseError: invalid input syntax for type uuid: "[object Object]"

Context

You had similar issues on:

  1. ID created as '[object Object]' #121
  2. [*] Default Values - Field DATEONLY with defaultValue shows incorrect data on form #164

The only difference between the problem we are facing and the one from issue #121 is that the UID on our models is not a primaryKey.

uid: {
  type: Sequelize.UUID,
  defaultValue: Sequelize.UUIDV4
}

I found a workaround for the bug by deleting [object Object] when creating an instance of a model on the frontend, but that could be a pain for users internally.

  • Package Version: forest-express-sequelize 2.16.3
  • Express Version: 4.16.2
  • Sequelize Version: 4.37.10
  • Database Dialect: Postgres
  • Database Version:

Thanks!

@arnaudbesnier
Copy link
Member

Hi @rodrigo4244,

Good catch! Thank you for all the context. This is something we need to fix

@arnaudbesnier
Copy link
Member

This is fixed here: 280b10f

The fix is now available in the latest liana version v2.16.4.
Let me know if your issue persists.

🌲🌲🌲

@rodrigo4244
Copy link
Author

Thanks @arnaudbesnier!

I just checked and it is working as I would expect :)

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

No branches or pull requests

2 participants