feat: add needsVehicleSelection frontend hook (refs #60)

- Add NeedsVehicleSelectionResponse type
- Add needsVehicleSelection API method
- Add useNeedsVehicleSelection hook with staleTime: 0

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Eric Gullickson
2026-01-24 11:27:02 -06:00
parent 684615a8a2
commit baf576f5cb
3 changed files with 19 additions and 1 deletions

View File

@@ -19,6 +19,17 @@ export const useSubscription = () => {
});
};
export const useNeedsVehicleSelection = () => {
const { isAuthenticated, isLoading } = useAuth0();
return useQuery({
queryKey: ['needs-vehicle-selection'],
queryFn: () => subscriptionApi.needsVehicleSelection(),
enabled: isAuthenticated && !isLoading,
staleTime: 0, // Always fetch fresh on login
});
};
export const useCheckout = () => {
const queryClient = useQueryClient();
return useMutation({