Closed GideonNeedleman closed 9 months ago
I just checked and actually this problem doesn't occur. When editing a set the ids are completely regenerated upon save, so what you actually get is:
ex3.sets[
id: 1,
]
ex2.sets[
id: 2,
id: 3,
]
So there's no problem. This bodes well for saving Just Go or modified workouts bc there won't be any id conflict. And then if this workout is later edited, the ids will all be regenerated anyway.
May get conflicting set ids if I edit a workout by deleting an exercise, then adding a new exercise.
For example, assume 2 exercises:
Then I delete exercise 1 and replace it with exercise 3. Would I get the following result?
Since when adding ex3 the number of existing sets is 2, so I'd assign setId to be 3, but this conflicts with setId 3 in exercise 2.
Maybe just go with unique UUIDs or something for all sets. Or eliminate sets and rely on array index.
I want to be able to save modified workouts from
DoWorkout
and Just Go.