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 ============= diff --git a/FRONTEND/src/components/ui/FilterPanel.jsx b/FRONTEND/src/components/ui/FilterPanel.jsx index db5f8ad..f6b9bb1 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 7b88409..2d4b448 100644 --- a/FRONTEND/src/pages/HomePage.jsx +++ b/FRONTEND/src/pages/HomePage.jsx @@ -157,6 +157,7 @@ const HomePage = () => { }} maxW="250px" aria-label="Sort products" + isDisabled={isSearching} > @@ -195,7 +196,7 @@ const HomePage = () => { - { {/* Sidebar with Filters — hidden when store has no products */} {!hasNoProducts && ( - + )} + {/* Product grid — skeletons while loading, real cards when ready */}