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