mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-28 09:36:16 +01:00
refactor: replace deprecated call with api call
This commit is contained in:
@@ -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');
|
||||||
|
|||||||
Reference in New Issue
Block a user