From 7600c19964b98b2648c92a5a3eac56c1f40a6699 Mon Sep 17 00:00:00 2001 From: inyoung Date: Thu, 18 Apr 2024 23:38:43 +0900 Subject: [PATCH] Fix: revised api url reflection 228 --- src/api/patch.ts | 18 +++++++++++++-- .../Buyer/BuyerSearch/SearchHeader.tsx | 2 +- src/pages/Buyer/BuyerSearchResult.tsx | 23 +++++++++++-------- 3 files changed, 31 insertions(+), 12 deletions(-) diff --git a/src/api/patch.ts b/src/api/patch.ts index a710a214..01c3115f 100644 --- a/src/api/patch.ts +++ b/src/api/patch.ts @@ -64,9 +64,23 @@ export const patchApplyPayments = async (id: any) => //SearchWord Controller //검색 결과 반환 -export const patchSearchWordsResults = async (sortType: string, body: any) => - await patchPublicInstance(`/searchWords/results?sortType=${sortType}`, body); +export const patchSearchWordsCounselorsResults = async ( + sortType: string, + body: any, +) => + await patchPublicInstance( + `/searchWords/results/counselors?sortType=${sortType}`, + body, + ); +export const patchSearchWordsPostsResults = async ( + sortType: string, + body: any, +) => + await patchPublicInstance( + `/searchWords/results/posts?sortType=${sortType}`, + body, + ); //Wishlist Controlloer //찜하기 추가 export const patchWishLists = async (counselorId: number) => diff --git a/src/components/Buyer/BuyerSearch/SearchHeader.tsx b/src/components/Buyer/BuyerSearch/SearchHeader.tsx index 09de255e..b18b73ca 100644 --- a/src/components/Buyer/BuyerSearch/SearchHeader.tsx +++ b/src/components/Buyer/BuyerSearch/SearchHeader.tsx @@ -64,7 +64,7 @@ const BackIcon = styled(Back)` `; const FormWrapper = styled.form` position: relative; - width: 80%; + width: 100%; `; const SearchIcon = styled(Search)` position: absolute; diff --git a/src/pages/Buyer/BuyerSearchResult.tsx b/src/pages/Buyer/BuyerSearchResult.tsx index ad24a046..efa3ef98 100644 --- a/src/pages/Buyer/BuyerSearchResult.tsx +++ b/src/pages/Buyer/BuyerSearchResult.tsx @@ -17,7 +17,10 @@ import { searchKeywordState, } from 'utils/atom'; import Input from 'components/Common/Input'; -import { patchSearchWordsResults } from 'api/patch'; +import { + patchSearchWordsCounselorsResults, + patchSearchWordsResults, +} from 'api/patch'; import { SearchResultData } from 'utils/type'; import { ConverSortType } from 'utils/convertSortType'; import { ReactComponent as Empty } from 'assets/icons/graphic-noting.svg'; @@ -81,7 +84,10 @@ export const BuyerSearchResult = () => { index: pageIndex, }; const sortTypeString: string = ConverSortType(sortType); - const res: any = await patchSearchWordsResults(sortTypeString, body); + const res: any = await patchSearchWordsCounselorsResults( + sortTypeString, + body, + ); if (res.status === 200) { if (res.data.length !== 0) { if (pageIndex === 0) { @@ -155,8 +161,8 @@ export const BuyerSearchResult = () => { placeHolderColor={Grey4} height="4.4rem" width="100%" - padding="0 3.2rem 0 0" - textIndent="1rem" + isBoxSizing={true} + padding="0.8rem 3.4rem 0.8rem 1.6rem" /> @@ -230,26 +236,25 @@ const Wrapper = styled.div` `; const HeaderWrapper = styled.div` height: 5.2rem; + gap: 0.8rem; background-color: ${White}; position: relative; display: flex; align-items: center; justify-content: center; + box-sizing: border-box; padding: 0.4rem 2rem; `; const FormWrapper = styled.form` position: relative; - width: 79%; + width: 100%; `; const BackIcon = styled(Back)` - position: absolute; - top: 1.4rem; - left: 2rem; cursor: pointer; `; const SearchIcon = styled(Search)` position: absolute; - right: -2.7rem; + right: 0.8rem; top: 0.8rem; cursor: pointer; `;