From 5199f5b97e35957b32d8a6e6b1a370e643f2605c Mon Sep 17 00:00:00 2001 From: Hasini Date: Sun, 21 Jun 2026 20:22:31 +0530 Subject: [PATCH 1/3] fix: reset review filters when product changes --- FRONTEND/src/components/ui/ProductReviews.jsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/FRONTEND/src/components/ui/ProductReviews.jsx b/FRONTEND/src/components/ui/ProductReviews.jsx index ee5a835..87f9e10 100644 --- a/FRONTEND/src/components/ui/ProductReviews.jsx +++ b/FRONTEND/src/components/ui/ProductReviews.jsx @@ -508,6 +508,12 @@ const ProductReviews = ({ productId }) => { const [filterStar, setFilterStar] = useState(null); const [sortOrder, setSortOrder] = useState('newest'); + useEffect(() => { + setFilterStar(null); + setSortOrder('newest'); + setPage(1); + }, [productId]); + const textColor = useColorModeValue('gray.500', 'gray.400'); const buildQuery = useCallback(() => { From 95f962c959d09d073654127997b4e5298b1d72fd Mon Sep 17 00:00:00 2001 From: Hasini Date: Mon, 22 Jun 2026 19:29:46 +0530 Subject: [PATCH 2/3] fix: disable sort and filters during search --- FRONTEND/src/components/ui/FilterPanel.jsx | 12 +++++++++--- FRONTEND/src/pages/HomePage.jsx | 7 ++++++- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/FRONTEND/src/components/ui/FilterPanel.jsx b/FRONTEND/src/components/ui/FilterPanel.jsx index bfca71a..6ad5c0b 100644 --- a/FRONTEND/src/components/ui/FilterPanel.jsx +++ b/FRONTEND/src/components/ui/FilterPanel.jsx @@ -7,7 +7,7 @@ import { } from '@chakra-ui/react'; import { useProductStore } from '../../store/product'; -const FilterPanel = ({ filters, setFilters }) => { +const FilterPanel = ({ filters, setFilters, isDisabled = false }) => { const [localFilters, setLocalFilters] = useState(filters); const [categories, setCategories] = useState([]); const [brands, setBrands] = useState([]); @@ -101,6 +101,7 @@ const FilterPanel = ({ filters, setFilters }) => { handleCategoryChange(cat)} > @@ -122,6 +123,7 @@ const FilterPanel = ({ filters, setFilters }) => { handleBrandChange(brand)} > @@ -143,6 +145,7 @@ const FilterPanel = ({ filters, setFilters }) => { @@ -166,6 +169,7 @@ const FilterPanel = ({ filters, setFilters }) => { onChange={(e) => setLocalFilters({ ...localFilters, minRating: Number(e.target.value) }) } + isDisabled={isDisabled} > @@ -184,6 +188,7 @@ const FilterPanel = ({ filters, setFilters }) => { onChange={(e) => setLocalFilters({ ...localFilters, inStock: e.target.checked }) } + isDisabled={isDisabled} > In Stock Only @@ -192,10 +197,11 @@ const FilterPanel = ({ filters, setFilters }) => { - - diff --git a/FRONTEND/src/pages/HomePage.jsx b/FRONTEND/src/pages/HomePage.jsx index baecb37..463429c 100644 --- a/FRONTEND/src/pages/HomePage.jsx +++ b/FRONTEND/src/pages/HomePage.jsx @@ -145,6 +145,7 @@ const HomePage = () => { }} maxW="250px" aria-label="Sort products" + isDisabled={isSearching} > @@ -186,7 +187,11 @@ const HomePage = () => { {/* Sidebar with Filters */} - + {/* Product grid — skeletons while loading, real cards when ready */} From 29b32258e886838840cc438c85af99693210f08d Mon Sep 17 00:00:00 2001 From: Hasini Date: Mon, 22 Jun 2026 19:50:59 +0530 Subject: [PATCH 3/3] fix: register stripe webhook before rate limiter --- BACKEND/app.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/BACKEND/app.js b/BACKEND/app.js index fa8ef40..588fe4f 100644 --- a/BACKEND/app.js +++ b/BACKEND/app.js @@ -98,11 +98,12 @@ app.use(cors({ credentials: true })); app.use(passport.initialize()); -app.use("/api", limiter); // Stripe webhook needs raw body — must be registered before express.json() app.post("/api/checkout/webhook", express.raw({ type: 'application/json' }), stripeWebhook); +app.use("/api", limiter); + app.use(express.json()); // ============= API ROUTES =============