From cefd4061ca1036a73480ee7cfd25a2394a448639 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Tue, 31 Oct 2023 16:41:32 -0400 Subject: [PATCH] fix: #12141, use apiv3 for category search module --- public/src/modules/categorySearch.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/src/modules/categorySearch.js b/public/src/modules/categorySearch.js index 5dccf8308a..ed9788ca3e 100644 --- a/public/src/modules/categorySearch.js +++ b/public/src/modules/categorySearch.js @@ -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); }