From 115d436a06c704917ec37fd2ca1e8fc0fc18966f Mon Sep 17 00:00:00 2001 From: noirscape Date: Wed, 4 Jan 2023 22:34:48 +0100 Subject: [PATCH] client: fix some incorrect references --- client/js/controllers/post_main_controller.js | 2 +- client/js/controls/pool_navigator_list_control.js | 5 +---- client/js/models/post_list.js | 1 - client/js/views/post_main_view.js | 6 +++--- server/szurubooru/func/posts.py | 2 +- 5 files changed, 6 insertions(+), 10 deletions(-) diff --git a/client/js/controllers/post_main_controller.js b/client/js/controllers/post_main_controller.js index b60a1686..5576b0e2 100644 --- a/client/js/controllers/post_main_controller.js +++ b/client/js/controllers/post_main_controller.js @@ -19,7 +19,7 @@ class PostMainController extends BasePostController { let poolPostsNearby = Promise.resolve({results: []}); if (api.hasPrivilege("pools:list") && api.hasPrivilege("pools:view")) { - poolPostsNearby = PostList.getNearbyPoolPosts(ctx.parameters.id) + poolPostsNearby = PostList.getNearbyPoolPosts(ctx.parameters.id); } let parameters = ctx.parameters; diff --git a/client/js/controls/pool_navigator_list_control.js b/client/js/controls/pool_navigator_list_control.js index cc9a8151..6aa5302f 100644 --- a/client/js/controls/pool_navigator_list_control.js +++ b/client/js/controls/pool_navigator_list_control.js @@ -28,9 +28,6 @@ class PoolNavigatorListControl extends events.EventTarget { poolListItemNode, poolPostNearby, ); - // events.proxyEvent(commentControl, this, "submit"); - // events.proxyEvent(commentControl, this, "score"); - // events.proxyEvent(commentControl, this, "delete"); this._indexToNode[poolPostNearby.id] = poolListItemNode; this._poolNavigatorListNode.appendChild(poolListItemNode); } @@ -49,4 +46,4 @@ class PoolNavigatorListControl extends events.EventTarget { } } -module.exports = PoolNavigatorListControl; \ No newline at end of file +module.exports = PoolNavigatorListControl; diff --git a/client/js/models/post_list.js b/client/js/models/post_list.js index 0d3655be..16df6eb8 100644 --- a/client/js/models/post_list.js +++ b/client/js/models/post_list.js @@ -19,7 +19,6 @@ class PostList extends AbstractList { static getNearbyPoolPosts(id) { return api.get( uri.formatApiLink("post", id, "pools-nearby", { - query: PostList._decorateSearchQuery(searchQuery || ""), fields: "id", }) ); diff --git a/client/js/views/post_main_view.js b/client/js/views/post_main_view.js index fa44eb27..805a9e73 100644 --- a/client/js/views/post_main_view.js +++ b/client/js/views/post_main_view.js @@ -58,7 +58,7 @@ class PostMainView { this._installSidebar(ctx); this._installCommentForm(); this._installComments(ctx.post.comments); - this._installPoolNavigators(ctx.poolPostsAround); + this._installPoolNavigators(ctx.poolPostsNearby); const showPreviousImage = () => { if (ctx.prevPostId) { @@ -139,7 +139,7 @@ class PostMainView { } } - _installPoolNavigators(poolPostsAround) { + _installPoolNavigators(poolPostsNearby) { const poolNavigatorsContainerNode = document.querySelector( "#content-holder .pool-navigators-container" ); @@ -149,7 +149,7 @@ class PostMainView { this.poolNavigatorsControl = new PoolNavigatorListControl( poolNavigatorsContainerNode, - poolPostsAround, + poolPostsNearby, ); } diff --git a/server/szurubooru/func/posts.py b/server/szurubooru/func/posts.py index f1e21889..c2d88c8d 100644 --- a/server/szurubooru/func/posts.py +++ b/server/szurubooru/func/posts.py @@ -1016,7 +1016,7 @@ def serialize_pool_posts_nearby( "pool": pools.serialize_micro_pool(entry.pool), "firstPost": serialize_micro_post(try_get_post_by_id(entry.first_post), None), "lastPost": serialize_micro_post(try_get_post_by_id(entry.last_post), None), - "prevPost": serialize_micro_post(try_get_post_by_id(entry.prev_post), None), + "previousPost": serialize_micro_post(try_get_post_by_id(entry.prev_post), None), "nextPost": serialize_micro_post(try_get_post_by_id(entry.next_post), None), } for entry in nearby ]