actual fix
This commit is contained in:
parent
254a30ff93
commit
c3a41d2b32
Binary file not shown.
@ -160,14 +160,15 @@ export default function FitnessProfileScreen() {
|
|||||||
const token = await getToken();
|
const token = await getToken();
|
||||||
|
|
||||||
// Prepare data with userId and convert fitnessGoal to fitnessGoals array
|
// Prepare data with userId and convert fitnessGoal to fitnessGoals array
|
||||||
|
// Convert empty strings to undefined for optional enum fields
|
||||||
const dataToSave = {
|
const dataToSave = {
|
||||||
userId: userId,
|
userId: userId,
|
||||||
height: profileData.height,
|
height: profileData.height,
|
||||||
weight: profileData.weight,
|
weight: profileData.weight,
|
||||||
age: profileData.age,
|
age: profileData.age,
|
||||||
gender: profileData.gender,
|
gender: profileData.gender || undefined,
|
||||||
fitnessGoals: profileData.fitnessGoal ? [profileData.fitnessGoal] : [],
|
fitnessGoals: profileData.fitnessGoal ? [profileData.fitnessGoal] : [],
|
||||||
activityLevel: profileData.activityLevel,
|
activityLevel: profileData.activityLevel || undefined,
|
||||||
medicalConditions: profileData.medicalConditions,
|
medicalConditions: profileData.medicalConditions,
|
||||||
allergies: profileData.allergies,
|
allergies: profileData.allergies,
|
||||||
injuries: profileData.injuries,
|
injuries: profileData.injuries,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user