Skip to content

Commit

Permalink
Merge pull request #206 from Step3-kakao-tech-campus/feat/#165
Browse files Browse the repository at this point in the history
fix: ProfileList 페이지 경로 문제 해결
  • Loading branch information
JeonDoGyun authored Nov 11, 2023
2 parents 08b68ad + 3de5418 commit 0899eb9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/pages/profileList/components/ProfileList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ const ProfileList = (prop: { prop: string }) => {
setCurrentPage(page);
navigate(`/profile/${prop.prop}/${page}`);
};

const word = prop.prop === 'urgent' ? 'sos' : prop.prop;
const urlWord = word === 'home' ? '' : word;

const [list, setList] = useState<ProfileListProps | null>(null);

const { data, isLoading, isError } = useQuery({
queryKey: ['list', currentPage],
queryFn: () => useFetch(`/pet/profiles/${word}?page=${currentPage}`),
queryFn: () => useFetch(`/pet/profiles/${urlWord}?page=${currentPage}`),
});

useEffect(() => {
Expand Down

0 comments on commit 0899eb9

Please sign in to comment.