smartAction is not a function

This is a template you can use to report issues. You can also drag images, videos and include Preformatted text

Expected behavior

Create a smart action following the docs

Actual behavior

TypeError: permissionMiddlewareCreator.smartAction is not a function

Failure Logs

  // Upload CSV to account'/actions/upload-csv', permissionMiddlewareCreator.smartAction(), (req, res) => {
    const accountId =[0]
    console.log('accountID', accountId)

    const attrs =
    const csv = attrs.csv
    console.log('CSV', csv)
    res.send({ success: 'CSV Uploaded' })


Please provide any relevant information about your setup.

  • Package Version:
  • Express Version: 4.16.3
  • Sequelize Version: 5.15.1
  • Database Dialect: Postgres
  • Database Version:
  • Project Name:
	"dependencies": {
		"chalk": "~1.1.3",
		"cookie-parser": "1.4.4",
		"cors": "2.8.5",
		"cross-env": "^7.0.2",
		"debug": "~4.0.1",
		"dotenv": "~6.1.0",
		"express": "~4.16.3",
		"express-jwt": "5.3.1",
		"forest-express-sequelize": "^5.5.0",
		"https": "^1.0.0",
		"morgan": "1.9.1",
		"pg": "~6.1.0",
		"require-all": "^3.0.0",
		"sequelize": "~5.15.1"

Hi @NFhbar,

Welcome to the ForestAdmin community and thank you for sharing your concern with us!

permissionMiddlewareCreator is a middleware creator provided by the forest-express-sequelize library.

On the route file where you defined your upload-csv route, could ensure that you correctly imported and instantiated the permissionMiddlewareCreator:

const { PermissionMiddlewareCreator } = require('forest-express-sequelize');
const permissionMiddlewareCreator = new PermissionMiddlewareCreator('your-sequelize-model-name');