Skip to content

Commit

Permalink
Bug fix in ExerciseForm
Browse files Browse the repository at this point in the history
  • Loading branch information
paulzakin committed Feb 26, 2024
1 parent 1d75618 commit f26c992
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
21 changes: 12 additions & 9 deletions src/components/forms/ExerciseForm/ExerciseForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,20 +122,23 @@ export const ExerciseForm: React.FC<props> = ({ item, profile }) => {
Number(minutes),
MET
)
const category =
exerciseGroup === 'Lifting'
? liftingActivity
: exerciseGroup === 'Swimming'
? swimmingActivity
: exerciseGroup === 'Other'
? otherActivity
: null

console.log(category)
const dataToSubmit = {
amount: round(amount, 0),
category:
exerciseGroup === 'Lifting'
? liftingActivity
: exerciseGroup === 'Swimming'
? swimmingActivity
: exerciseGroup === 'Custom'
? otherActivity
: null,
category,
duration: prep(minutes),
groupName: exerciseGroup,
incline: prep(incline),
name,
name: exerciseGroup === 'Custom' ? name : '',
pace: prep(mph),
power: prep(watt),
weight: prep(weight),
Expand Down
2 changes: 1 addition & 1 deletion src/components/forms/ExerciseForm/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export type SwimmingMET = typeof swimmingMET
export type SwimmingActivity = keyof SwimmingMET

export const liftingMET = {
'Free weights': 5,
'Free Weights': 5,
Machines: 3.5,
} as const

Expand Down
2 changes: 2 additions & 0 deletions src/components/list/ExerciseLogList/ExerciseLogItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ export const ExerciseLogItem: React.FC<{ exercise_log: ExerciseLog }> = (

const src = Exercise.src

console.log(category)

return (
<Item
item={{
Expand Down

0 comments on commit f26c992

Please sign in to comment.