Skip to content

Commit

Permalink
refactor : sortOption type 구체적으로 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
00kang committed Jun 4, 2024
1 parent edcab84 commit 92b560d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/hooks/useProducts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ interface UseProductsResult {
selectedSort: string;
}

const sortOptionsMap: { [key: string]: string } = {
const sortOptionsMap: Record<"price,asc" | "price,desc", string> = {
"price,asc": "낮은 가격순",
"price,desc": "높은 가격순",
};
Expand Down Expand Up @@ -85,6 +85,6 @@ export default function useProducts(): UseProductsResult {
setCategory,
resetPage,
selectedCategory: category,
selectedSort: sortOptionsMap[sortOption],
selectedSort: sortOptionsMap[sortOption as "price,asc" | "price,desc"],
};
}

0 comments on commit 92b560d

Please sign in to comment.