From b8896d132842afd17f117d498861d813316aeecf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Thu, 16 Dec 2021 13:46:49 -0500 Subject: [PATCH] refactor: only pass qs --- src/socket.io/categories/search.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/socket.io/categories/search.js b/src/socket.io/categories/search.js index 529ee136f4..ad04c20edf 100644 --- a/src/socket.io/categories/search.js +++ b/src/socket.io/categories/search.js @@ -50,10 +50,12 @@ module.exports = function (SocketCategories) { }; async function findMatchedCids(uid, data) { - const params = { ...data, uid, paginate: false }; - params.query = data.search; - params.qs = data.query; - const result = await categories.search(params); + const result = await categories.search({ + uid: uid, + query: data.search, + qs: data.query, + paginate: false, + }); let matchedCids = result.categories.map(c => c.cid); // no need to filter if all 3 states are used