mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-01 21:30:30 +01:00
fix: sort setting not using correct field name
This commit is contained in:
@@ -24,7 +24,7 @@ define('forum/category', [
|
||||
|
||||
topicList.init('category', loadTopicsAfter);
|
||||
|
||||
sort.handleSort('categoryTopicSort', 'setCategorySort', 'category/' + ajaxify.data.slug);
|
||||
sort.handleSort('categoryTopicSort', 'category/' + ajaxify.data.slug);
|
||||
|
||||
if (!config.usePagination) {
|
||||
navigator.init('[component="category/topic"]', ajaxify.data.topic_count, Category.toTop, Category.toBottom, Category.navigatorCallback);
|
||||
|
||||
@@ -49,7 +49,7 @@ define('forum/topic', [
|
||||
threadTools.init(tid, $('.topic'));
|
||||
events.init();
|
||||
|
||||
sort.handleSort('topicPostSort', 'setTopicSort', 'topic/' + ajaxify.data.slug);
|
||||
sort.handleSort('topicPostSort', 'topic/' + ajaxify.data.slug);
|
||||
|
||||
if (!config.usePagination) {
|
||||
infinitescroll.init($('[component="topic"]'), posts.loadMorePosts);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
define('sort', ['components', 'api'], function (components, api) {
|
||||
var module = {};
|
||||
|
||||
module.handleSort = function (field, key, gotoOnSave) {
|
||||
module.handleSort = function (field, gotoOnSave) {
|
||||
var threadSort = components.get('thread/sort');
|
||||
threadSort.find('i').removeClass('fa-check');
|
||||
var currentSetting = threadSort.find('a[data-sort="' + config[field] + '"]');
|
||||
@@ -20,7 +20,7 @@ define('sort', ['components', 'api'], function (components, api) {
|
||||
}
|
||||
var newSetting = $(this).attr('data-sort');
|
||||
if (app.user.uid) {
|
||||
api.put(`/users/${app.user.uid}/settings/${key}`, {
|
||||
api.put(`/users/${app.user.uid}/settings/${field}`, {
|
||||
value: newSetting,
|
||||
}).then(() => {
|
||||
refresh(newSetting, utils.params());
|
||||
|
||||
Reference in New Issue
Block a user