From a7ffc886d39288b0703141c9a1d574eee8abcafd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cspicecat=E2=80=9D?= Date: Wed, 17 Aug 2022 21:18:01 -0400 Subject: [PATCH] reduce throttle and search bar all fields --- client/src/controllers/SearchBarController.js | 6 ++++-- server/utils/api.js | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/client/src/controllers/SearchBarController.js b/client/src/controllers/SearchBarController.js index a066a1a..2202691 100644 --- a/client/src/controllers/SearchBarController.js +++ b/client/src/controllers/SearchBarController.js @@ -15,11 +15,13 @@ export default function SearchBarController() { e.preventDefault(); if (location.pathname === '/questions/search') { - setSearchParams({ title: search }, { replace: true }); + setSearchParams({ title: search, text: search, creator: search }, { replace: true }); } else { navigate({ pathname: '/questions/search', - search: `?${createSearchParams({ title: search })}`, + search: `?${createSearchParams({ + title: search, text: search, creator: search + })}`, replace: true, }); } diff --git a/server/utils/api.js b/server/utils/api.js index 3ffb215..c0c18ba 100644 --- a/server/utils/api.js +++ b/server/utils/api.js @@ -3,7 +3,7 @@ const superagent = require('superagent'); const Throttle = require('superagent-throttle'); const throttle = new Throttle({ active: true, - rate: 5, + rate: 2, ratePer: 1000, concurrent: 2, });