From bda3373dd4f6242b81a9610eed20f81c8728866c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Mon, 30 Nov 2020 12:16:54 -0500 Subject: [PATCH] feat: switch to using api for quick reply --- public/modules/quickreply.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/public/modules/quickreply.js b/public/modules/quickreply.js index 42a473a..185c999 100644 --- a/public/modules/quickreply.js +++ b/public/modules/quickreply.js @@ -2,7 +2,9 @@ /*globals $, app, ajaxify, socket*/ -define('persona/quickreply', ['components', 'composer/autocomplete'], function(components, autocomplete) { +define('persona/quickreply', [ + 'components', 'composer/autocomplete', 'api' +], function(components, autocomplete, api) { var QuickReply = {}; QuickReply.init = function() { @@ -36,8 +38,7 @@ define('persona/quickreply', ['components', 'composer/autocomplete'], function(c handle: undefined, content: replyMsg }; - - socket.emit('posts.reply', replyData, function(err, data) { + api.post(`/topics/${ajaxify.data.tid}`, replyData, function (err, data) { if (err) { return app.alertError(err.message); }