Skip to content

Commit cf8a675

Browse files
committed
fix: 경매장 거래 내역 정렬 기준 오류 수정
1 parent f1995cc commit cf8a675

File tree

5 files changed

+22
-10
lines changed

5 files changed

+22
-10
lines changed

src/app/(main)/auction-history/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,8 +323,8 @@ export default function Page() {
323323

324324
return (
325325
<div className="select-none absolute inset-0 bg-white">
326-
{/* Fixed Floating Category Sidebar - Only visible on xl+ screens */}
327-
<div className="fixed left-24 top-32 bottom-8 w-56 z-40 hidden xl:block">
326+
{/* Fixed Floating Category Sidebar - Only visible on 2xl+ screens (1536px+) */}
327+
<div className="fixed left-24 top-32 bottom-8 w-56 z-40 hidden 2xl:block">
328328
<CategorySection
329329
selectedId={selectedCategory}
330330
onSelect={handleCategorySelect}

src/app/api/auction-history/search/route.ts

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,25 @@ export async function GET(request: NextRequest) {
9292
// Extract pagination parameters
9393
const page = searchParams.get("page") || "1";
9494
const size = searchParams.get("size") || "20";
95-
const sortBy = searchParams.get("sortBy") || "DATE_AUCTION_BUY"; // enum value
96-
const direction = searchParams.get("direction") || "DESC"; // enum value
95+
const sortBy = searchParams.get("sortBy") || "dateAuctionBuy";
96+
const direction = searchParams.get("direction") || "desc";
97+
98+
// Map frontend values to backend enum names
99+
const sortByMap: Record<string, string> = {
100+
dateAuctionBuy: "DATE_AUCTION_BUY",
101+
auctionPricePerUnit: "AUCTION_PRICE_PER_UNIT",
102+
itemName: "ITEM_NAME",
103+
};
104+
105+
const directionMap: Record<string, string> = {
106+
asc: "ASC",
107+
desc: "DESC",
108+
};
97109

98110
pageParams.page = page;
99111
pageParams.size = size;
100-
pageParams.sortBy = sortBy;
101-
pageParams.direction = direction;
112+
pageParams.sortBy = sortByMap[sortBy] || "DATE_AUCTION_BUY";
113+
pageParams.direction = directionMap[direction.toLowerCase()] || "DESC";
102114

103115
// Extract basic search parameters
104116
const itemName = searchParams.get("itemName");

src/components/commons/Search.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,11 @@ export default function SearchSection({
133133
{/* Breadcrumb */}
134134
{path.length > 0 && (
135135
<div className="flex items-center gap-2 mb-4 text-sm flex-wrap">
136-
{/* Category Menu Button - Hidden on xl+ screens */}
136+
{/* Category Menu Button - Hidden on 2xl+ screens (1536px+) */}
137137
{onCategoryMenuClick && (
138138
<button
139139
onClick={onCategoryMenuClick}
140-
className="xl:hidden flex items-center justify-center w-8 h-8 rounded-lg hover:bg-gray-100 transition-colors"
140+
className="2xl:hidden flex items-center justify-center w-8 h-8 rounded-lg hover:bg-gray-100 transition-colors"
141141
aria-label="카테고리 메뉴 열기"
142142
>
143143
<Menu className="w-5 h-5 text-gray-600" />

src/components/page/community/PostCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export default function PostCard({ post }: PostCardProps) {
2626

2727
return (
2828
<Link href={`/community/${post.id}`} className="block">
29-
<article className="bg-white rounded-lg p-4 sm:p-6 border border-gray-200 hover:border-gray-300 transition-colors">
29+
<article className="py-4 hover:bg-blue-50/50 transition-colors cursor-pointer">
3030
{/* Post Content */}
3131
<div className="mb-3">
3232
<h3 className="font-semibold text-gray-900 mb-2 line-clamp-2">

src/components/page/community/PostList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export default function PostList({ boardId }: PostListProps) {
7474
}
7575

7676
return (
77-
<div className="space-y-3">
77+
<div className="divide-y divide-gray-200">
7878
{allPosts.map((post) => (
7979
<PostCard key={post.id} post={post} />
8080
))}

0 commit comments

Comments
 (0)