Fix PR #34: Fetch profile before generateBox()
This commit is contained in:
parent
2f8cde0409
commit
52555112e1
1 changed files with 4 additions and 0 deletions
|
|
@ -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'];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue