mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: #12141, use apiv3 for category search module
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
define('categorySearch', ['alerts', 'bootstrap'], function (alerts, bootstrap) {
|
||||
define('categorySearch', ['alerts', 'bootstrap', 'api'], function (alerts, bootstrap, api) {
|
||||
const categorySearch = {};
|
||||
|
||||
categorySearch.init = function (el, options) {
|
||||
@@ -70,7 +70,7 @@ define('categorySearch', ['alerts', 'bootstrap'], function (alerts, bootstrap) {
|
||||
});
|
||||
|
||||
function loadList(search, callback) {
|
||||
socket.emit('categories.categorySearch', {
|
||||
api.get('/search/categories', {
|
||||
search: search,
|
||||
query: utils.params(),
|
||||
parentCid: options.parentCid || 0,
|
||||
@@ -78,7 +78,7 @@ define('categorySearch', ['alerts', 'bootstrap'], function (alerts, bootstrap) {
|
||||
privilege: options.privilege,
|
||||
states: options.states,
|
||||
showLinks: options.showLinks,
|
||||
}, function (err, categories) {
|
||||
}, function (err, { categories }) {
|
||||
if (err) {
|
||||
return alerts.error(err);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user