forest-express-sequelize icon indicating copy to clipboard operation
forest-express-sequelize copied to clipboard

[*] Charts - Charts may have wrong field mapping field to sequelize model.

Open Jekiwijaya opened this issue 6 years ago • 1 comments

Steps to reproduce

  1. Map the model attribute createdAt to field created_at
  2. Create line dashboard grouping by createdAt attribute

Expected behavior

Dashboard show no error.

Actual behavior

Dashboard show error SQLITE_ERROR: no such column: User.createdAt

Failure Logs

[forest] 🌳🌳🌳  Unexpected error: SQLITE_ERROR: no such column: User.createdAt
SequelizeDatabaseError: SQLITE_ERROR: no such column: User.createdAt

Context

I think that's because of this line https://github.com/ForestAdmin/forest-express-sequelize/blob/c51a60694d5e6809bc471108f9ad7098e814d114/services/line-stat-getter.js#L25-L26

It straight getting the column name from models attribute name, instead of the field option.

  • Package Version: 3.2.3
  • Express Version: 4.16.2
  • Sequelize Version: 4.41.2
  • Database Dialect: sqlite
  • Database Version:

Jekiwijaya avatar Jul 02 '19 06:07 Jekiwijaya

Hi @Jekiwijaya, Thank you for the feedback. We'll try to look at your PR this week.

arnaudbesnier avatar Jul 07 '19 21:07 arnaudbesnier