mirror of
https://codeberg.org/andyscott/ExerciseTracker.git
synced 2024-12-21 11:43:10 -05:00
Validation too strict, removed typeof checks
This commit is contained in:
parent
552187d53e
commit
caf5bdab80
1 changed files with 2 additions and 2 deletions
|
@ -96,9 +96,9 @@ app.put(
|
|||
let resultVal;
|
||||
if (req.body.name === "" || typeof req.body.name !== "string") {
|
||||
isValid = false;
|
||||
} else if (typeof req.body.reps !== "number" || req.body.reps < 1) {
|
||||
} else if (req.body.reps < 1) {
|
||||
isValid = false;
|
||||
} else if (typeof req.body.weight !== "number" || req.body.weight < 1) {
|
||||
} else if (req.body.weight < 1) {
|
||||
isValid = false;
|
||||
} else if (req.body.unit !== "lbs" && req.body.unit !== "kgs") {
|
||||
isValid = false;
|
||||
|
|
Loading…
Reference in a new issue