refactor: replace deprecated call with api call

This commit is contained in:
Barış Soner Uşaklı
2023-12-14 10:13:19 -05:00
parent d13bfacd74
commit f91b823ecc

View File

@@ -1,7 +1,7 @@
'use strict'; 'use strict';
define('forum/topic/replies', ['forum/topic/posts', 'hooks', 'alerts'], function (posts, hooks, alerts) { define('forum/topic/replies', ['forum/topic/posts', 'hooks', 'alerts', 'api'], function (posts, hooks, alerts, api) {
const Replies = {}; const Replies = {};
Replies.init = function (button) { Replies.init = function (button) {
@@ -14,8 +14,8 @@ define('forum/topic/replies', ['forum/topic/posts', 'hooks', 'alerts'], function
if (open.is(':not(.hidden)') && loading.is('.hidden')) { if (open.is(':not(.hidden)') && loading.is('.hidden')) {
open.addClass('hidden'); open.addClass('hidden');
loading.removeClass('hidden'); loading.removeClass('hidden');
api.get(`/posts/${pid}/replies`, {}, function (err, { replies }) {
socket.emit('posts.getReplies', pid, function (err, postData) { const postData = replies;
loading.addClass('hidden'); loading.addClass('hidden');
if (err) { if (err) {
open.removeClass('hidden'); open.removeClass('hidden');