-
Notifications
You must be signed in to change notification settings - Fork 3
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
✨ feat(#20) 내가 받은 초대 목록 컴포넌트 제작 #99
Merged
Merged
Changes from 1 commit
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
5aa6faa
✨ feat(#20): 내가 초대받은 대시보드 목록을 보여주는 페이지 추가
wjsdncl 0e09de8
🎨 design(#20): Image 오류 수정
wjsdncl 07d6fc9
✨ feat(#20): API 연동 및 UI 구현 완료
wjsdncl f748cb8
✨ feat(#20): 초대 목록 state 관리 및 렌더링 구현
wjsdncl d0b2e85
Merge branch 'develop' into feat/mydashboard-invite-lists
wjsdncl 54297c6
🛠 fix(#20): 충돌 해결
wjsdncl 3ee0f75
✨ feat(#20): 초대받은 대시보드 검색 기능 추가
wjsdncl dd46375
♻️ refactor(#20): 내가 받은 초대 목록 컴포넌트 구조 변경 및 분리
wjsdncl b21866c
♻️ refactor(#20): getInvitationsList 수정
wjsdncl d7d8ebf
✨ feat(#20): 초대 수락 시 대시보드 리스트 갱신
wjsdncl b34c8d9
♻️ refactor(#20): develop 브랜치 병합
wjsdncl e06c000
✨ feat(#20): 무한스크롤 구현
wjsdncl 90110f9
🎨 design(#20): 반응형 디자인 설정
wjsdncl 66d3f4d
Merge branch 'develop' into feat/mydashboard-invite-lists
wjsdncl 0fd8ac9
🛠 fix(#20): 초대 목록 무한스크롤 수정
wjsdncl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import { useQueryClient } from '@tanstack/react-query'; | ||
import { debounce } from 'lodash'; | ||
import Image from 'next/image'; | ||
import { useState, useEffect, useCallback } from 'react'; | ||
import { useQueryClient } from 'react-query'; | ||
|
||
import InvitationItemList from './InvitationItem'; | ||
import SearchBar from './InvitationSearch'; | ||
|
@@ -12,7 +12,7 @@ import { putAcceptInvitation } from '@/services/putService'; | |
import { Invitation, InvitationsResponse } from '@/types/Invitation.interface'; | ||
|
||
export default function InvitedDashboardList() { | ||
const { data, error, isLoading } = useFetchData<InvitationsResponse>('invitations', () => getInvitationsList()); | ||
const { data, error, isLoading } = useFetchData<InvitationsResponse>(['invitations'], () => getInvitationsList()); | ||
const [invitations, setInvitations] = useState<Invitation[]>([]); | ||
const queryClient = useQueryClient(); | ||
|
||
|
@@ -26,8 +26,9 @@ export default function InvitedDashboardList() { | |
try { | ||
await putAcceptInvitation(invitationId, inviteAccepted); | ||
setInvitations((prevInvitations) => prevInvitations.filter((invitation) => invitation.id !== invitationId)); | ||
queryClient.invalidateQueries(['dashboards']); // 특정 쿼리 키 무효화하여 다시 가져옴 | ||
queryClient.invalidateQueries({ queryKey: ['dashboards'] }); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이거 좋은데, 그러면 사이드바만 다시 가져오고 대시보드 목록은 그대로 아닌가요?? 대시보드 목록에 새로 만든것일수록 아래로 가나요 위로 가나요?? |
||
} catch (err) { | ||
// eslint-disable-next-line no-console | ||
console.error('Error updating invitation:', err); | ||
} | ||
}; | ||
|
You are viewing a condensed version of this merge commit. You can view the full changes here.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
inviteAccepted true일 때만 대시보드 목록 다시 가져오면 좋을 것 같습니다.