Skip to content

Node.js based forum software built for the modern web

update state on new flag so action history is appended

Julian Lam597e375463cb
diff --git a/src/posts/flags.js b/src/posts/flags.js
index 3f42e9c988..7c04eb8982 100644
--- a/src/posts/flags.js
+++ b/src/posts/flags.js
@@ -60,6 +60,13 @@ module.exports = function(Posts) {
}
}
], next);
+ },
+ function(data, next) {
+ if (data[1] === 1) { // Only update state on new flag
+ Posts.updateFlagData(uid, post.pid, {
+ state: 'open'
+ }, next);
+ }
}
], function(err) {
if (err) {