handling errors :rage2:

v1.18.x
Julian Lam 9 years ago
parent b12607b1de
commit 4897e861fb

@ -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);
});

Loading…
Cancel
Save