From 6c04e393b523607b6f352d5e5ffe72b364f20f10 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Thu, 12 Jan 2017 10:03:45 -0500 Subject: [PATCH] fire hooks for flag update --- src/flags.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/flags.js b/src/flags.js index 168eb5a11e..dd7b038b92 100644 --- a/src/flags.js +++ b/src/flags.js @@ -470,9 +470,13 @@ Flags.update = function (flagId, uid, changeset, callback) { // Save new object to db (upsert) tasks.push(async.apply(db.setObject, 'flag:' + flagId, changeset)); + // Append history tasks.push(async.apply(Flags.appendHistory, flagId, uid, changeset)); + // Fire plugin hook + tasks.push(async.apply(plugins.fireHook, 'action:flag.update', { changeset: changeset, uid: uid })); + async.parallel(tasks, function (err, data) { return next(err); });