-
Notifications
You must be signed in to change notification settings - Fork 2
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] 경매 list detail 챙기기 #53
Conversation
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.
수고하셨습니다! sort관련 params 파일이 분리되어서 가독성이 높아진 것 같아요!
|
||
const { data } = useGetBasicAuctionList({ | ||
title: searchKeywordParam || '', | ||
auctionStatus: searchParams.get(SEARCHPARAM_KEY.AUCTIONSTATUS) || '', | ||
sort: searchParams.get(SEARCHPARAM_KEY.SORT) || '', | ||
direction: searchParams.get(SEARCHPARAM_KEY.DIRECTION) || '', |
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.
최신순으로 초기화 해주는 것은 어떤가요? 처음 해당 페이지에 들어왔을때, 빈 것으로 들어가 있으니까 조금 어색하게 느껴지는 것 같아요. 그런데 얘도 서버에서 자체적으로 default sort요소가 있을테니 그것으로 초기값을 해줘도 좋을 것 같아요.
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.
currentSort 설정을 잘못해서 빈 값으로 보였네요. 수정했습니다~
export interface GetBasicAuctionListParams { | ||
title?: string; | ||
sort?: string; | ||
auctionStatus?: string; | ||
auctionStatus?: AuctionStatusType | string; |
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.
타입을 지정했는데 string이랑 union으로 묶인 이유가 뭔가요?
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.
이게 유니온으로 지정하니까 useGetBasicAuctionList에서 searchParams.get()을 하면 string 값으로 인식해서 타입 에러가 발생하더라고요. 그냥 AuctionStatusType 제거해서 광범위하게 string 타입으로 놓을까요?
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.
그게 나을 것 같기도 해요... 저렇게 유니온으로 잡아놓으면 Type을 타이트하게 잡아놓음의 메리트가 없는 것 같네요
|
||
return ( | ||
<Dropdown> | ||
<Dropdown.Trigger>{selected}</Dropdown.Trigger> | ||
<Dropdown.Trigger>{findSortType?.label}</Dropdown.Trigger> |
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.
여기서 옵셔닝 값을 빼고, findSortType에서 return 하는 것에 default가 있는 것은 어떤가요?
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.
현재 기본 api가 최신순으로 되어 있어서 default 값을 최신순으로 설정하였습니다.
src/static/sort.ts
Outdated
@@ -0,0 +1,58 @@ | |||
export const SEARCHPARAM_KEY = { |
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.
검색과 관련되어 쓸 수 있는 sort관련 요소는 해당 파일에 분리해둬도 좋을 것 같네요! 그렇다면 BE에서 뭔가 변경되어도 일괄적으로 적용이 가능하겠어요!
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.
오 좋습니다! queryParam이라는 파일로 분리했습니다. 나중에 BidList도 여기에 추가하면 될 듯 합니다!
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.
수고하셨습니다~!
What is this PR? 🔍
Changes 📝
ScreenShot 📷
Precaution
✔️ Please check if the PR fulfills these requirements
develop
branch unconditionally?main
?npm run lint