Actions
ClientProject #3135
open[FE] Auto parts ui and api integration
Start date:
09/08/2025
Due date:
09/09/2025 (about 7 months late)
% Done:
100%
Estimated time:
6:00 h
Spent time:
Description
- Added a new route /auto-parts with a page component displaying auto parts listings.
- Introduced AutoSection and AutoListCard components to render product cards with dummy data.
- Implemented detailed product card layout, including specifications and an enquiry button.
- Set up structure for future integration with real product data and pagination.
- AutoListCard: Refactored to use new auto parts fields (e.g., parts_name, sub_ref_no, chassis_code, etc.), removed car-specific fields, and updated the table to display relevant auto parts info.
- AutoSection: Now fetches and displays auto parts products from the new API (getAutoPartsProducts), removing dummy data and adapting pagination.
- Types: Exported AutoPartsProductDataList for type safety in components.
- Breadcrumb: Updated breadcrumb label from "Stock List" to "Auto Parts" for clarity.
- Added a reusable useFetchCountries hook to centralize country fetching logic.
- Replaced direct country fetching in EnquireModal with the new hook.
- Introduced a new PartsInquiryForm component for auto parts inquiries, using the new hook and form validation.
- Updated AutoListCard to show the new inquiry form and "Ask for Price!" message.
- Replaced enquireSchema with a new enquireModalSchema for modal-specific validation.
- Updated API route to use the new schema and removed unused Name field.
- Refactored PartsInquiryForm to accept product props and submit them to the API.
- Added loading state and toast notifications for form submission feedback.
- Improved form styling and input handling for better UX.
Actions