debug: extensive frontend logging for goal dates
All checks were successful
Deploy Development / deploy (push) Successful in 54s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 14s

This commit is contained in:
Lars 2026-03-28 14:46:06 +01:00
parent b7e7817392
commit 623f34c184

View File

@ -114,6 +114,14 @@ export default function GoalsPage() {
]) ])
setGoalMode(modeData.goal_mode) setGoalMode(modeData.goal_mode)
// Debug: Check what we received from API
console.log('[DEBUG] Received goals from API:', goalsData.length)
const weightGoal = goalsData.find(g => g.goal_type === 'weight')
if (weightGoal) {
console.log('[DEBUG] Weight goal from API:', JSON.stringify(weightGoal, null, 2))
}
setGoals(goalsData) setGoals(goalsData)
setGroupedGoals(groupedData) setGroupedGoals(groupedData)
@ -188,8 +196,10 @@ export default function GoalsPage() {
} }
const handleEditGoal = (goal) => { const handleEditGoal = (goal) => {
console.log('[DEBUG] Editing goal:', goal) console.log('[DEBUG] Editing goal ID:', goal.id)
console.log('[DEBUG] Full goal object:', JSON.stringify(goal, null, 2))
console.log('[DEBUG] start_date from goal:', goal.start_date, 'type:', typeof goal.start_date) console.log('[DEBUG] start_date from goal:', goal.start_date, 'type:', typeof goal.start_date)
console.log('[DEBUG] target_date from goal:', goal.target_date, 'type:', typeof goal.target_date)
setEditingGoal(goal.id) setEditingGoal(goal.id)
setFormData({ setFormData({