fix: #12141, use apiv3 for category search module

This commit is contained in:
Julian Lam
2023-10-31 16:41:32 -04:00
parent 7d8f700f56
commit cefd4061ca

View File

@@ -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);
}