Skip to content

Commit

Permalink
fix: 검색 저장하는 로직 삭제
Browse files Browse the repository at this point in the history
  • Loading branch information
Songhyejeong committed Nov 19, 2024
1 parent 627b84c commit e754eb3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 42 deletions.
15 changes: 2 additions & 13 deletions src/components/common/store/StoreList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { getStoreList } from '../../../apis/api/getStoreList';
import { getStoreAll } from '../../../apis/api/getStoreAll';
import { useLocation, useNavigate } from 'react-router-dom';
import Button from '../button/Button';
import { useStoreList, useIsFetch, useFilterParams, useTagList, useSearchInput } from '../../../store';
import { useStoreList, useIsFetch, useFilterParams, useTagList } from '../../../store';
import Filtering from '../filtering/Filtering';
import SearchBar from '../searchBar/SearchBar';

Expand All @@ -20,17 +20,7 @@ const StoreList = () => {
const [hasMore, setHasMore] = useState(true);
const [isNothing, setIsNothing] = useState(false);

const { setSearchInput, searchInput } = useSearchInput();

let initInput = '';

if (location.state?.searchInput) {
initInput = location.state?.searchInput;
} else if (searchInput) {
initInput = searchInput;
}

const [input, setInput] = useState(initInput);
const [input, setInput] = useState(location.state?.searchInput);
const [orderByRating, setOrderByRating] = useState(null);
const [orderByPositiveRatio, setorderByPositiveRatio] = useState(null);

Expand Down Expand Up @@ -208,7 +198,6 @@ const StoreList = () => {
Params.searchKeywords = input;
initStores();
fetchStores();
setSearchInput(input);
}
};

Expand Down
12 changes: 1 addition & 11 deletions src/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,5 @@ import useStoreDetail from './useStoreDetail';
import useTagList from './useTagList';
import useLogin from './useLogin';
import useSaveBookmarkId from './useSaveBookmarkId';
import useSearchInput from './useSearchInput';

export {
useStoreList,
useIsFetch,
useFilterParams,
useStoreDetail,
useTagList,
useLogin,
useSaveBookmarkId,
useSearchInput,
};
export { useStoreList, useIsFetch, useFilterParams, useStoreDetail, useTagList, useLogin, useSaveBookmarkId };
18 changes: 0 additions & 18 deletions src/store/useSearchInput.jsx

This file was deleted.

0 comments on commit e754eb3

Please sign in to comment.