javascript - How to update record in SailsJS without triggering model lifecycle callbacks -


I have a model where I have to retain the record after updating or saving new records in the table. The problem is that updated updates to UpdateTree are updated after the callback.

  module.exports = {id: 'role', attributes: {.}, AfterCreate: function (rec, cb) {fixTree (); CB (); }, AfterUpdate: function (Rick, CB) {fixTree (); CB (); }}} Function fixTree () {/ * code here * / Role.update (....); /  I am using controller functions  
  create: function (req, res) {var data = {}; Data.name = req.body.name; Data.parent = req.body.parent; Role.create (data, function (mistake, record) {role.tree.fix (function () {res.ok (record);}}}}); }, Update: Function (Rick, Race) {var data = {}; Data.name = req.body.name; Data.parent = req.body.parent; Role.update (req.params.id, data, function (error, records) {role.tree.fix (function () {res.ok (record);}}}}); },  

Comments

Popular posts from this blog

c# - NewtonSoft JArray - how to select multiple elements with LINQ -

c# - Process.Kill() returns access denied -

c# - Using the generic type 'System.Collections.Generic.List<T>' requires 1 type arguments -