From 2829a0097a689ec696ca266772f204fa7d19b244 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Wed, 31 May 2023 10:45:33 +0200 Subject: [PATCH] Fix search expand when searching user' posts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- app/soapbox/actions/search.ts | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/app/soapbox/actions/search.ts b/app/soapbox/actions/search.ts index a2f165ac06..3f8d2011e8 100644 --- a/app/soapbox/actions/search.ts +++ b/app/soapbox/actions/search.ts @@ -119,17 +119,22 @@ const setFilter = (filterType: SearchFilter) => }; const expandSearch = (type: SearchFilter) => (dispatch: AppDispatch, getState: () => RootState) => { - const value = getState().search.value; - const offset = getState().search.results[type].size; + const value = getState().search.value; + const offset = getState().search.results[type].size; + const accountId = getState().search.accountId; dispatch(expandSearchRequest(type)); + const params: Record = { + q: value, + type, + offset, + }; + + if (accountId) params.account_id = accountId; + api(getState).get('/api/v2/search', { - params: { - q: value, - type, - offset, - }, + params, }).then(({ data }) => { if (data.accounts) { dispatch(importFetchedAccounts(data.accounts));