Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

동네생활/검색 기능 관련 오류 #102

Open
hitkoo opened this issue Feb 8, 2023 · 0 comments
Open

동네생활/검색 기능 관련 오류 #102

hitkoo opened this issue Feb 8, 2023 · 0 comments

Comments

@hitkoo
Copy link

hitkoo commented Feb 8, 2023

pagenation이 2페이지 이후일때 검색하면 검색어에 해당하는 동네생활글이 있음에도 검색이 되지않습니다.

export const requestNeighborhood = async (
  accessToken: string,
  page: number,
  keyword: string,
) => {
  try {
    if (keyword === '') {
      return await axiosI.get(`/neighborhood/?page=${page}`, {
        headers: auth(accessToken),
      });
    } else {
      return await axios.get(
        `${BASE_URL}/neighborhood/?page=${page}&keyword=${keyword}`,
        {
          headers: auth(accessToken),
        },
      );
    }
  } catch (e) {
    return e;
  }
};

keyword가 있을 때 /neighborhood/?page=${page}&keyword=${keyword} 로 api콜을 보내는데
keyword 변경 시 page를 default로 set 하는 useEffect가 있어야할 것 같습니다.

image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant