Indie-Kart / ecommerce-store

https://indiekart.vercel.app/
MIT License
39 stars 59 forks source link

[BUG]:TypeScript Error: Property 'quantity' does not exist on type 'CartItemProps' #196

Open iamabhishek2828 opened 3 days ago

iamabhishek2828 commented 3 days ago

Is there an existing issue for this?

What happened?

Issue Title: TypeScript Error: Property 'quantity' does not exist on type 'CartItemProps'

Description: When attempting to use the CartItem component in ./app/(routes)/cart/components/cart-item.tsx, TypeScript throws an error indicating that the quantity property is missing from the CartItemProps type. This error prevents the component from compiling correctly.

Steps to Reproduce:

  1. Navigate to ./app/(routes)/cart/components/cart-item.tsx.
  2. Ensure TypeScript is configured to check types.
  3. Attempt to compile the project using TypeScript.

Expected Behavior: The CartItemProps type should include the quantity property to correctly type the CartItem component. This would allow the component to receive and utilize the quantity prop without TypeScript errors.

Actual Behavior: TypeScript throws an error stating that the quantity property does not exist on type CartItemProps.

Additional Information:

Screenshots/Code Snippets:

// Example of CartItemProps definition
interface CartItemProps {
  data: any;
  quantity: number; // This line is missing in the current definition
  handleAdd: () => void;
  handleDec: () => void;
}

Proposed Solution: Update the CartItemProps interface in ./app/(routes)/cart/components/cart-item.tsx to include the quantity property as shown in the code snippet above. This change should resolve the TypeScript error.

Record

github-actions[bot] commented 3 days ago

Hello @iamabhishek2828! Thanks for creating issue #196 on #Indie-Kart/ecommerce-store.Please Comment /assign-me to self assign this issue to yourself, and please don't forget to star this repo.

iamabhishek2828 commented 3 days ago

/assign-me