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

refactor : merit Api querykey factor #874

Merged
merged 5 commits into from
Jan 18, 2024

Conversation

jasper200207
Copy link
Collaborator

연관 이슈

작업 요약

Merit Api 쿼리키 포멧 통일

작업 상세 설명

querykey factory에 맞춰 수정하였습니다.

리뷰 요구사항

1분

@jasper200207 jasper200207 added the Refactor 리팩토링 label Jan 18, 2024
@jasper200207 jasper200207 self-assigned this Jan 18, 2024
Comment on lines 7 to 11
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,
};
Copy link
Contributor

Choose a reason for hiding this comment

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

param -> params
로 변경해주세요~!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

반영했습니다!

@@ -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, {
Copy link
Contributor

Choose a reason for hiding this comment

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

{ page, size } -> params로 변수 따로 빼서 fetcher랑 같이 반영해줘도 좋을 것 같습니다!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

반영했습니다

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,
Copy link
Member

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, 이런식으로!

Copy link
Contributor

Choose a reason for hiding this comment

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

저도 그랬던 것 같..습니다!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

반영했습니다

Copy link
Contributor

@publdaze publdaze left a comment

Choose a reason for hiding this comment

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

👍👍

Copy link
Member

@pipisebastian pipisebastian left a comment

Choose a reason for hiding this comment

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

👍

@jasper200207 jasper200207 merged commit ca0fb45 into develop Jan 18, 2024
1 check passed
@jasper200207 jasper200207 deleted the feature/meritApi_쿼리키_포맷_통일_#865 branch January 18, 2024 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Refactor 리팩토링
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

meritApi 쿼리키 포멧 통일
3 participants