fix(dashboard): source discover vehicles from live inventory API - #225
Open
harystyleseze wants to merge 1 commit into
Open
fix(dashboard): source discover vehicles from live inventory API#225harystyleseze wants to merge 1 commit into
harystyleseze wants to merge 1 commit into
Conversation
Replace the hard-coded vehicle fixture in DiscoverVehicles with a fetch against /api/vehicles, adding loading, error/retry, and empty states. Delisted, fully-funded, and stale opportunities are no longer actionable.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The vehicle discovery card grid rendered a fixed, hard-coded list of eight fictional vehicles (with invented drivers, returns, and funding progress) instead of the platform's real vehicle inventory, so it could present fabricated investment opportunities as if they were live listings.
Changes
components/dashboard/discover-vehicles.tsx: removed the hard-codedmockVehiclesfixture and now fetches vehicles from the existingGET /api/vehiclesinventory endpoint on mount and on manual refresh.fundingStatusisOpen, itsstatusisAvailable, and the data is not stale.totalFundedAmount/price,complianceStatus, driver-assignment presence, and vehicle specifications) instead of fabricated driver names, ratings, and locations.components/dashboard/__tests__/discover-vehicles.test.tsx(new): covers empty inventory, API failure, network failure, delisted-vehicle exclusion, fully-funded vehicles being non-actionable, and partial/missing optional fields.Issues
Resolves #196
Verification
cargo buildwas not run.cargo testwas not run.