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

fix: 필터 및 페이징이 정상동작하지 않는 이슈 해결 #387

Merged
merged 1 commit into from
Sep 13, 2021
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
4 changes: 2 additions & 2 deletions frontend/src/hooks/useFilterWithParams.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ const useFilterWithParams = () => {
};

const getFullParams = useCallback(() => {
if (postQueryParams.page == 1) {
delete postQueryParams.page
if (postQueryParams.page === 1) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아.. 이거였군요ㅎㅎ 감사합니다!

delete postQueryParams.page;
}

const pageParams = queryString.stringify(postQueryParams);
Expand Down
6 changes: 1 addition & 5 deletions frontend/src/pages/ProfilePagePosts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,8 @@ const ProfilePagePosts = () => {
useEffect(() => {
const params = getFullParams();

if (!params) {
return;
}

history.push(`${PATH.ROOT}${username}/posts${params ? '?' + params : ''}`);
}, [getFullParams, postQueryParams, selectedFilterDetails, username]);
}, [postQueryParams, selectedFilterDetails, username]);

useEffect(() => {
if (!shouldInitialLoad) {
Expand Down