Skip to content

Commit

Permalink
feat: add client side action:flag.create
Browse files Browse the repository at this point in the history
  • Loading branch information
barisusakli committed Sep 2, 2020
1 parent 2a4f4f5 commit 09de364
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion public/src/modules/flags.js
Expand Up @@ -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 });
});
}

Expand Down

0 comments on commit 09de364

Please sign in to comment.