Fix PR #34: Fetch profile before generateBox()

This commit is contained in:
OpenClaw Agent 2026-05-02 14:46:21 -07:00
parent 2f8cde0409
commit 52555112e1

View file

@ -36,6 +36,10 @@ export default function CuratedBox() {
const generateBox = async (userId) => {
try {
// Fetch user profile first
const profileRes = await fetch(`/api/profile/${userId}`);
const profile = await profileRes.json();
// Use actual user profile preferences, or fallback to defaults
const preferredColors = profile?.preferred_colors || ['Black', 'White', 'Navy', 'Grey'];
const stylePreferences = profile?.style_preferences || ['Classic', 'Casual'];