exclude fields on post, put request in epilogue

Viewed 369

I am using expressjs with sequalize ORM. My user model is some what like

module.exports = function (sequelize, DataTypes) {
 var User = sequelize.define('user', {
    userName: {
      type: DataTypes.STRING
    },
    isAdmin: {
      type: DataTypes.Boolean
    }
   })
  }

but I dont want to allow the request to set isAdmin to be set to true or false on POST/PUT. But i want isAdmin on get request.

I know about excludeAttributes property but it removes the fields on GET request only.

1 Answers
Related