Skip to content

Commit ca8e64f

Browse files
committed
fix: correct sticker category check and improve price filter logic
1 parent 68c6f1d commit ca8e64f

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/routes/category/components/product-card/index.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
import { Link } from "react-router";
2+
23
import type { Product } from "@/models/product.model";
34

45
interface ProductCardProps {
56
product: Product;
67
}
78

8-
const stickerCategoryId = 3;
9+
const stickerCategoryId = 3; // ID de la categoría "Stickers"
910

1011
export function ProductCard({ product }: ProductCardProps) {
11-
12-
const isSticker = stickerCategoryId;
13-
12+
13+
const isSticker = product.categoryId === stickerCategoryId;
14+
1415
return (
1516
<>
1617
<Link

src/routes/category/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ export async function loader({ params, request }: Route.LoaderArgs) {
4848
if (min) {
4949
return (productPrice||minProductPrice) >= min
5050
}
51+
5152
if (max) {
5253
return (productPrice||maxProductPrice) <= max
53-
5454
}
5555
return true
5656
});

0 commit comments

Comments
 (0)