Skip to content

Commit

Permalink
Fix: revised api url reflection 228
Browse files Browse the repository at this point in the history
  • Loading branch information
rmdnps10 committed Apr 18, 2024
1 parent 07a82dc commit 7600c19
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 12 deletions.
18 changes: 16 additions & 2 deletions src/api/patch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) =>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Buyer/BuyerSearch/SearchHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const BackIcon = styled(Back)`
`;
const FormWrapper = styled.form`
position: relative;
width: 80%;
width: 100%;
`;
const SearchIcon = styled(Search)`
position: absolute;
Expand Down
23 changes: 14 additions & 9 deletions src/pages/Buyer/BuyerSearchResult.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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"
/>
<SearchIcon onClick={handleSubmit} />
</FormWrapper>
Expand Down Expand Up @@ -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;
`;
Expand Down

0 comments on commit 7600c19

Please sign in to comment.