fitness: fix template edit validation and allow empty sets
All checks were successful
CI / update (push) Successful in 2m6s
All checks were successful
CI / update (push) Successful in 2m6s
- Validate exerciseId instead of name (templates use exerciseId, not name) - Remove mandatory reps minimum from template sets - Allow exercises with empty sets in schema and API validation
This commit is contained in:
@@ -66,13 +66,7 @@ const ExerciseSchema = new mongoose.Schema({
|
||||
},
|
||||
sets: {
|
||||
type: [SetSchema],
|
||||
required: true,
|
||||
validate: {
|
||||
validator: function(sets: ISet[]) {
|
||||
return sets.length > 0;
|
||||
},
|
||||
message: 'An exercise must have at least one set'
|
||||
}
|
||||
default: []
|
||||
},
|
||||
restTime: {
|
||||
type: Number,
|
||||
|
||||
Reference in New Issue
Block a user