Sequelize TypeError

Hey folks, wondering if you could help me with an issue I’m getting when using one of the examples in the Forest Admin docs

Expected behavior

Should be able to do

 const lesson = await new RecordGetter(
      lessons,
      request.user,
      request.query
    ).get(request.params.recordId);

following an example from here Prevent record update - Woodshop
Should be able to log the lesson record once the promise has successfully resolved.

Actual behavior

What is the current behavior?

At the moment, I’m getting a TypeError:


which must be coming from Sequelize. Not sure how to resolve this issue - unless it is something wrong with the version

“express”: “^4.17.1”,
“forest-express-sequelize”: “^7.3.1”,
Database Dialect: postgres
postgres:12
“sequelize”: “~5.15.1”

  • Project Name: Oak National Academy

Hi @Mitchell_Lloyd, hope you are doing well.

You are using the version 7 of forest-express-sequelize with an example code for the v8 :confused:
An easy fix for this would be to switch from

const lesson = await new RecordGetter(
      lessons,
      request.user,
      request.query
    )

To

 const lesson = await new RecordGetter(
      lessons,
    )

Or switch to our latest v8 :smiley:

Let me know if that helps :pray:

1 Like

Thanks @jeffladiray this solved the problem perfectly !
:slight_smile:

1 Like