feat: add client side action:flag.create

This commit is contained in:
Barış Soner Uşaklı
2020-09-02 14:06:04 -04:00
parent 2a4f4f5aec
commit 09de364e93

View File

@@ -63,13 +63,15 @@ define('flags', function () {
if (!type || !id || !reason) { if (!type || !id || !reason) {
return; 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) { if (err) {
return app.alertError(err.message); return app.alertError(err.message);
} }
flagModal.modal('hide'); flagModal.modal('hide');
app.alertSuccess('[[flags:modal-submit-success]]'); app.alertSuccess('[[flags:modal-submit-success]]');
$(window).trigger('action:flag.create', { flagId: flagId, data: data });
}); });
} }