and AI recommnedation fix
This commit is contained in:
dimitar committed 2025-12-12 01:32:52 +01:00
1 parent 670e6675cc
commit 8353a24f6b
17 files changed
+134 -138

No files matched your search

@@ -76,7 +76,7 @@ export async function POST(request: Request) {
userId,
fitnessProfileId,
type: 'ai_plan',
content: recommendationText,
recommendationText: recommendationText,
activityPlan,
dietPlan,
status: status || 'pending'
@@ -90,7 +90,7 @@ export async function POST(request: Request) {
id: crypto.randomUUID(),
userId,
type,
content,
recommendationText: content,
status: status || 'pending'
})
return NextResponse.json(recommendation)
@@ -122,8 +122,8 @@ export async function PUT(request: Request) {
const updated = await db.updateRecommendation(id, {
...(status && { status }),
...(recommendationText && { content: recommendationText }), // Map legacy field
...(content && { content }),
...(recommendationText && { recommendationText }),
...(content && { recommendationText: content }),
...(activityPlan && { activityPlan }),
...(dietPlan && { dietPlan })
})