mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-24 00:09:41 +01:00
handling errors :rage2:
This commit is contained in:
@@ -50,6 +50,7 @@
|
||||
"flag_manage_history_assignee": "Assigned to %1",
|
||||
"flag_manage_history_state": "Updated state to %1",
|
||||
"flag_manage_history_notes": "Updated flag notes",
|
||||
"flag_manage_saved": "Flag Details Updated",
|
||||
|
||||
"deleted_message": "This topic has been deleted. Only users with topic management privileges can see it.",
|
||||
|
||||
|
||||
@@ -190,7 +190,11 @@ define('admin/manage/flags', [
|
||||
pid: pid,
|
||||
data: formData
|
||||
}, function(err) {
|
||||
console.log(arguments);
|
||||
if (err) {
|
||||
return app.alertError(err.message);
|
||||
} else {
|
||||
app.alertSuccess('[[topic:flag_manage_saved]]');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -273,6 +273,10 @@ module.exports = function(Posts) {
|
||||
var prop;
|
||||
|
||||
Posts.getPostData(pid, function(err, postData) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
|
||||
// Track new additions
|
||||
for(prop in flagObj) {
|
||||
if (flagObj.hasOwnProperty(prop) && !postData.hasOwnProperty('flag:' + prop)) {
|
||||
@@ -378,6 +382,10 @@ module.exports = function(Posts) {
|
||||
next(err, event);
|
||||
})
|
||||
}, function(err, history) {
|
||||
if (err) {
|
||||
return next(err);
|
||||
}
|
||||
|
||||
post['flag:history'] = history;
|
||||
next(null, post);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user