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';
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 = {};
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')) {
open.addClass('hidden');
loading.removeClass('hidden');
socket.emit('posts.getReplies', pid, function (err, postData) {
api.get(`/posts/${pid}/replies`, {}, function (err, { replies }) {
const postData = replies;
loading.addClass('hidden');
if (err) {
open.removeClass('hidden');