-
Notifications
You must be signed in to change notification settings - Fork 8
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
[FE] 비회원 로그인 페이지와 약속 조회/수정 페이지를 연결 #105
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
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
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
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
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,14 +1,12 @@ | ||
import { useQuery } from '@tanstack/react-query'; | ||
import React from 'react'; | ||
import { useParams } from 'react-router-dom'; | ||
|
||
import { handleGetMeetingSchedules } from '@apis/getMeetingSchedules'; | ||
import { getMeetingMySchedule } from '@apis/getMeetingSchedules'; | ||
|
||
import { QUERY_KEY } from '@constants/queryKeys'; | ||
|
||
import TimePicker from '.'; | ||
|
||
const TEST_UUID = '550e8400'; | ||
|
||
interface TimePickerContainerProps { | ||
firstTime: string; | ||
lastTime: string; | ||
|
@@ -20,16 +18,15 @@ export default function TimePickerContainer({ | |
lastTime, | ||
availableDates, | ||
}: TimePickerContainerProps) { | ||
const attendeeName = localStorage.getItem('meetingAttendee'); | ||
const params = useParams<{ uuid: string }>(); | ||
const uuid = params.uuid!; | ||
Comment on lines
+21
to
+22
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. [P2] 현재 |
||
const { data: meetingSchedules } = useQuery({ | ||
queryKey: [QUERY_KEY.meetingSchedules, attendeeName], | ||
queryFn: () => | ||
handleGetMeetingSchedules({ uuid: TEST_UUID, attendeeName: attendeeName as string }), | ||
queryKey: [QUERY_KEY.meetingMySchedule], | ||
queryFn: () => getMeetingMySchedule(uuid), | ||
staleTime: 0, | ||
}); | ||
|
||
if (!meetingSchedules) return <></>; | ||
if (!('attendeeName' in meetingSchedules)) return <></>; | ||
if (!meetingSchedules) return null; | ||
|
||
return ( | ||
<TimePicker | ||
|
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
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export const COOKIE_KEYS = { | ||
token: 'token', | ||
attendeeName: 'attendeeName', | ||
}; |
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,4 +1,5 @@ | ||
export const QUERY_KEY = { | ||
meeting: 'meeting', | ||
meetingSchedules: 'meetingSchedules', | ||
meetingMySchedule: 'meetingMySchedule', | ||
} as const; |
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
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
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
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
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.
[Comment]
오늘 약속 참여자 자신의 스케쥴을 조회하는 API 엔드포인트가
me
로 변경되었는데, getMeetingMySchedule함수 이름도 getMeetingMeSchedule로 변경하는 것이 좋을까요? 🤔함수명 자체는 어색한 것 같은데 백엔드 엔드포이트와 맞추려면 어쩔수 없나 싶기도 하네요~
빙봉은 어떻게 생각하시나요
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.
@hwinkr
해리가 제안 주신 의견대로라면 API path가 변경되면 또 함수명을 그에 맞게 수정해야 하지 않을까요?
API 경로가 변경될 때마다 함수명도 수정해야 한다면, 프론트엔드 코드가 백엔드 API 구조에 너무 의존하게 되는 것 같습니다🤔
API 호출 함수명은 API 경로와 독립적으로, 해당 기능의 의미를 명확히 전달할 수 있도록 프론트엔드 관점에서 정의하는 것은 어떨까요?
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.
좋아요~ 그렇게 하는게 좋을 것 같아요 프론트엔드에서는
my
로 하시죠!