Skip to content

4. Search Query & API Integration for Borrow Page #19

@isha-patel-14

Description

@isha-patel-14

Integrate a search functionality and API on the Borrow Page to allow users to explore and filter products efficiently. The page should support:

  1. Random Product Fetching (Explore More Button)
  2. Category & Gender-based Filtering (Him/Her for Clothes, Footwear, Accessories)
  3. Search Query Support for Specific Product Searches

Task Breakdown:

Frontend Changes:

  1. Borrow Page Layout Updates:
    - Add a search bar to allow users to search for specific products.
    - Ensure that clicking on any category (e.g., "Footwear for Him") redirects users to the search page but pre-filters results accordingly.
    - Ensure that clicking on "Explore More" fetches random products from the database.

  2. Routing & Navigation:
    - Clicking on category cards (Him/Her for Clothes, Footwear, Accessories) should pass category & gender filters when navigating.
    - Clicking Explore More should navigate users to the same search page but display random products.

Backend & API Changes:

  1. Create API Route for Fetching Products:
    - Fetch products based on search queries.
    - Fetch random products for the "Explore More" section.
    - Fetch category & gender-based products when navigating from category cards.

  2. MongoDB Query Requirements:
    - Random Data Fetch (for "Explore More").
    - Category & Gender Filter (for Him/Her sections).
    - Search Query Handling (to match product names, descriptions, etc.)

Expected Outcome:

  • Users can browse random products through "Explore More".
  • Users can view products filtered by category & gender when selecting Him/Her options.
  • Users can search for specific products in the search bar.
  • The system fetches & displays relevant data dynamically.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions