mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
feat: add client side action:flag.create
This commit is contained in:
@@ -63,13 +63,15 @@ define('flags', function () {
|
||||
if (!type || !id || !reason) {
|
||||
return;
|
||||
}
|
||||
socket.emit('flags.create', { type: type, id: id, reason: reason }, function (err) {
|
||||
var data = { type: type, id: id, reason: reason };
|
||||
socket.emit('flags.create', data, function (err, flagId) {
|
||||
if (err) {
|
||||
return app.alertError(err.message);
|
||||
}
|
||||
|
||||
flagModal.modal('hide');
|
||||
app.alertSuccess('[[flags:modal-submit-success]]');
|
||||
$(window).trigger('action:flag.create', { flagId: flagId, data: data });
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user