-
Notifications
You must be signed in to change notification settings - Fork 1
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
refactor : merit Api querykey factor #874
The head ref may contain hidden characters: "feature/meritApi_\uCFFC\uB9AC\uD0A4_\uD3EC\uB9F7_\uD1B5\uC77C_#865"
Conversation
src/api/meritApi.ts
Outdated
meritLog: (param: PageAndSize & { meritType?: string }) => [...meritKeys.base, param] as const, | ||
meritType: (param: PageAndSize) => [...meritKeys.base, 'types', param] as const, | ||
membersMerit: (param: PageAndSize) => [...meritKeys.base, 'members', param] as const, | ||
memberMerit: (memberId: number, param: PageAndSize) => [...meritKeys.base, 'members', memberId, param] as const, | ||
}; |
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.
param
-> params
로 변경해주세요~!
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.
반영했습니다!
src/api/meritApi.ts
Outdated
@@ -56,7 +57,7 @@ const useGetMemberMeritQuery = ({ page, size = 10, memberId }: PageAndSize & { m | |||
}) | |||
.then(({ data }) => data); | |||
|
|||
return useQuery<MeritLog>(meritKeys.memberMerit({ page, size, memberId }), fetcher, { | |||
return useQuery<MeritLog>(meritKeys.memberMerit(memberId, { page, size }), fetcher, { |
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.
{ page, size }
-> params
로 변수 따로 빼서 fetcher랑 같이 반영해줘도 좋을 것 같습니다!
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.
반영했습니다
src/api/meritApi.ts
Outdated
meritLog: (params: PageAndSize & { meritType?: string }) => [...meritKeys.base, params] as const, | ||
meritType: (params: PageAndSize) => [...meritKeys.base, 'types', params] as const, | ||
membersMerit: (params: PageAndSize) => [...meritKeys.base, 'members', params] as const, | ||
memberMerit: (memberId: number, params: PageAndSize) => [...meritKeys.base, 'members', memberId, params] as const, |
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.
이거 중복되는 'members' 는 base처럼 하나 더 만드는거 아니었나용..?
members : [...meritKeys.base, 'members'] as const,
이런식으로!
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.
저도 그랬던 것 같..습니다!
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.
반영했습니다
- meritKeys 안의 members 분리 - params 묶기 - #865
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.
👍👍
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.
👍
연관 이슈
작업 요약
Merit Api 쿼리키 포멧 통일
작업 상세 설명
querykey factory에 맞춰 수정하였습니다.
리뷰 요구사항
1분