mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-22 00:10:25 +01:00
fix: closes #12246, direction is passed in as string as query param with new api call
cid isn't necessary in query params since its in path
This commit is contained in:
@@ -127,7 +127,6 @@ define('forum/category', [
|
|||||||
hooks.fire('action:topics.loading');
|
hooks.fire('action:topics.loading');
|
||||||
const params = utils.params();
|
const params = utils.params();
|
||||||
infinitescroll.loadMore(`/categories/${ajaxify.data.cid}/topics`, {
|
infinitescroll.loadMore(`/categories/${ajaxify.data.cid}/topics`, {
|
||||||
cid: ajaxify.data.cid,
|
|
||||||
after: after,
|
after: after,
|
||||||
direction: direction,
|
direction: direction,
|
||||||
query: params,
|
query: params,
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ categoriesAPI.getTopics = async (caller, data) => {
|
|||||||
|
|
||||||
let start = Math.max(0, parseInt(data.after || 0, 10));
|
let start = Math.max(0, parseInt(data.after || 0, 10));
|
||||||
|
|
||||||
if (data.direction === -1) {
|
if (parseInt(data.direction, 10) === -1) {
|
||||||
start -= infScrollTopicsPerPage;
|
start -= infScrollTopicsPerPage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ module.exports = function (SocketTopics) {
|
|||||||
parseInt(data.count, 10) || meta.config.postsPerPage || 20
|
parseInt(data.count, 10) || meta.config.postsPerPage || 20
|
||||||
));
|
));
|
||||||
|
|
||||||
if (data.direction === -1) {
|
if (parseInt(data.direction, 10) === -1) {
|
||||||
start -= infScrollPostsPerPage;
|
start -= infScrollPostsPerPage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user