Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/api/zip.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import instance from './instance';
// 서점 검색
export const searchBookstore = async (name: string, lat: number, lng: number) => {
try {
const response = await instance.get(`/api/bookstores/search?keyword=${name}&lat=${lat}&lng=${lng}`);
const response = await instance.get(`/api/bookstores/search?searchK=${name}&lat=${lat}&lng=${lng}`);
if (response.status == 200) {
return response.data;
}
Expand Down
9 changes: 6 additions & 3 deletions src/pages/Booksnap/BookSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,14 @@ const BookSearch = () => {
const bookname = ['구원의 날', '지구에서 한아뿐', '사이키쿠스오'];
const [recent, setRecent] = useState<RecentType[]>([]);
const [word, setWord] = useState('');
const isLogin = !!localStorage.getItem('accessToken');

useEffect(() => {
getRecentSearch('booktitle', 1, 10).then((data) => {
setRecent(data.data.searchHistory);
});
if (isLogin) {
getRecentSearch('booktitle', 1, 10).then((data) => {
setRecent(data.data.searchHistory);
});
}
}, []);

const handleClick = (bookName: string) => {
Expand Down