node.js - sails beforeValidation not called -


i saw beforevalidation called both create , update i'm thinking of using callback manipulate posted data before saving database seems beforevalidation not being called because _csrf being save in database , name not slugified.

example:

var slugify = require('slug'); ..... beforevalidation: function(values, next){  // don't save _csrf token in database  if(values._csrf) delete values._csrf;  // slugify name before saving in database  values.name = slugify(values.name);  next(); }  

thanks

because waterline lifecycle callback names have changed :)

beforevalidation beforevalidate, , aftervalidation aftervalidate.


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

How to get multiresult with multicondition in Sql Server -